entity framework core example
Example 1: c# .net core entity framework
Example 2: entity framework core
cd %ProjectDirectory%
dotnet ef dbcontext scaffold "connectionstring" Microsoft.EntityFrameworkCore.SqlServer -o Models --force
Example 3: paging entity framework core
public abstract class PagedResultBase
{
public int CurrentPage { get; set; }
public int PageCount { get; set; }
public int PageSize { get; set; }
public int RowCount { get; set; }
public int FirstRowOnPage
{
get { return (CurrentPage - 1) * PageSize + 1; }
}
public int LastRowOnPage
{
get { return Math.Min(CurrentPage * PageSize, RowCount); }
}
}
public class PagedResult<T> : PagedResultBase where T : class
{
public IList<T> Results { get; set; }
public PagedResult()
{
Results = new List<T>();
}
}