add: Order
This commit is contained in:
		| @ -1,4 +1,5 @@ | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using KonSoft.Admin.Entities; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Volo.Abp.AuditLogging.EntityFrameworkCore; | ||||
| using Volo.Abp.BackgroundJobs.EntityFrameworkCore; | ||||
| using Volo.Abp.Data; | ||||
| @ -53,6 +54,10 @@ public class AdminDbContext : | ||||
|  | ||||
|     #endregion | ||||
|  | ||||
|     #region 订单 | ||||
|     public DbSet<Order> Order { get; set; } | ||||
|     #endregion | ||||
|  | ||||
|     public AdminDbContext(DbContextOptions<AdminDbContext> options) | ||||
|         : base(options) | ||||
|     { | ||||
|  | ||||
| @ -0,0 +1,37 @@ | ||||
| using KonSoft.Admin.Entities; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Diagnostics.CodeAnalysis; | ||||
| using System.Linq; | ||||
| using System.Text; | ||||
| using System.Threading.Tasks; | ||||
| using Volo.Abp; | ||||
|  | ||||
| namespace KonSoft.Admin.EntityFrameworkCore.Configures | ||||
| { | ||||
|     public static class ApplicationDbContextModelBuilderExtensions | ||||
|     { | ||||
|         public static void ConfigureApplication([NotNull] this ModelBuilder builder) | ||||
|         { | ||||
|             Check.NotNull(builder, nameof(builder)); | ||||
|  | ||||
|             builder.Entity<Order>(b => | ||||
|             { | ||||
|                 b.ToTable(AdminConsts.DbTablePrefix + "Order" + AdminConsts.DbSchema); | ||||
|  | ||||
|                 b.OwnsOne(o => o.Address, a => | ||||
|                 { | ||||
|                     a.Property(p => p.ContactName).HasColumnName("ContactName").HasMaxLength(50); | ||||
|                     a.Property(p => p.ContactPhone).HasColumnName("ContactPhone").HasMaxLength(20); | ||||
|                     a.Property(p => p.DetailAddress).HasColumnName("DetailAddress").HasMaxLength(200); | ||||
|                     a.Property(p => p.City).HasColumnName("City").HasMaxLength(50); | ||||
|                     a.Property(p => p.District).HasColumnName("District").HasMaxLength(50); | ||||
|                 }); | ||||
|             }); | ||||
|  | ||||
|         } | ||||
|  | ||||
|  | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,21 @@ | ||||
| using KonSoft.Admin.Entities; | ||||
| using KonSoft.Admin.Repositories; | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Text; | ||||
| using System.Threading; | ||||
| using System.Threading.Tasks; | ||||
| using Volo.Abp.Domain.Repositories; | ||||
| using Volo.Abp.Domain.Repositories.EntityFrameworkCore; | ||||
| using Volo.Abp.EntityFrameworkCore; | ||||
|  | ||||
| namespace KonSoft.Admin.EntityFrameworkCore.Repositories | ||||
| { | ||||
|     public class OrderRepository : EfCoreRepository<AdminDbContext, Order>, IOrderRepository | ||||
|     { | ||||
|         public OrderRepository(IDbContextProvider<AdminDbContext> dbContextProvider) : base(dbContextProvider) | ||||
|         { | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 于鹏
					于鹏