The Insert method allows the insertion of data into your database.
The return value of an Insert method is a single row of data that has just been inserted.
You can insert using two forms, Named parameters and by object. The object can be a POCO or a dynamic (i.e. ExpandoObject).
Note: There are differences in the generated SQL when using Named Parameters or object, where the object includes all properties included on the object, but the Named Parameters only includes those you specify.
var user = _db.Users.Insert(Name: "Steve", Age: 50);
Generates the following SQL
@p0 = 'Steve' @p1 = 50 insert into [dbo].[Users] ([Name],[Age]) values (@p0,@p1)
var user = new User { Name = "Steve", Age = 50 };
_db.Users.Insert(user);
Generates the following SQL
@p0 = 'Steve' @p1 = null @p2 = 50 insert into [dbo].[Users] ([Name],[Age]) values (@p0,@p1,@p2)