The entity framework course is finished
This commit is contained in:
@ -12,8 +12,6 @@ namespace EntityFrameworkBasics
|
||||
public class ApplicationDBContext : DbContext
|
||||
{
|
||||
|
||||
public string Id { get; set; } = Guid.NewGuid().ToString("N");
|
||||
|
||||
#region Public properties
|
||||
|
||||
public DbSet<SettingsDataModel> Settings { get; set; }
|
||||
@ -36,6 +34,9 @@ namespace EntityFrameworkBasics
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
// Fluent Api
|
||||
modelBuilder.Entity<SettingsDataModel>().HasIndex(c => c.Name).IsUnique();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,7 +15,6 @@ namespace EntityFrameworkBasics
|
||||
/// <summary>
|
||||
/// The settings name
|
||||
/// </summary>
|
||||
[Required]
|
||||
[MaxLength(256)]
|
||||
public string Name { get; set; }
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user