SQL сильный>
Код: Выделить всё
CREATE TABLE MyEntity(
Id INT IDENTITY(1,1) NOT NULL,
MyProperty1 VARCHAR(50),
MyBool BIT NOT NULL DEFAULT 1
);
Код: Выделить всё
public void insertNewMyEntity()
{
MyEntity me = New MyEntity();
me.MyProperty1 = "Testing insert and default values with EF Core";
me.MyBool = 0;
dbContext.MyEntity.Add(me);
dbContext.SaveChanges();
}
Код: Выделить всё
INSERT INTO MyEntity(MyProperty1) VALUES ("Testing insert and default values with EF Core");
Код: Выделить всё
INSERT INTO MyEntity(MyProperty1, MyBool) VALUES ("Testing insert and default values with EF Core", 0);
Подробнее здесь: https://stackoverflow.com/questions/406 ... ework-core