Please enable JavaScript.
Coggle requires JavaScript to display documents.
Configuration Properties - Coggle Diagram
Configuration Properties
-
Configure Indexes
[Index(nameof(Name),IsUnique =true)] and builder.HasIndex(g => g.Name).IsUnique()
-
-
ValueConversion
-
CustomValueConversion
create a class CurrencyToSymbolConverter:ValueConverter<Currency,string>
Then Cofigure in which ever class you want to configure. Just in my case CinemaConfig using HasConversion
Keyless Entity
Configuration
-
modelBuilder.Entity<CinemaWithoutLocation>().ToSqlQuery("Select Id,Name From Cinemas").ToView(null)
-
-
-
Create View
Create and empty migration add your sql in Up section with migrationbuilder.SQL("Create View MovieCount") and In down section Down Down section add migrationBuilder.Down("drop view MovieCount")
-
Shadow Properties
Configure : builder.Property<DateTime>("CreatedDate").HasDefaultValueSql("GetDate()").HasColumnType("datetime2");
Consume using metadata properties of entity var createdDate = context.Entry(genre).Property<DateTime>("CreatedDate").CurrentValue;
OrderByDescending(g => EF.Property<DateTime>(g, "CreatedDate"))