Librame 5.0.1
See the version list below for details.
dotnet add package Librame --version 5.0.1
NuGet\Install-Package Librame -Version 5.0.1
<PackageReference Include="Librame" Version="5.0.1" />
paket add Librame --version 5.0.1
#r "nuget: Librame, 5.0.1"
// Install Librame as a Cake Addin
#addin nuget:?package=Librame&version=5.0.1
// Install Librame as a Cake Tool
#tool nuget:?package=Librame&version=5.0.1
Support ASP.NET MVC 6 + EntityFramework 7 + Kendo UI...
Product | Versions Compatible and additional computed target framework versions. |
---|---|
ASP.NET | aspnet50 is compatible. |
-
ASP.NET 5.0
- EntityFramework.SqlServer (>= 7.0.0-beta1)
- Microsoft.AspNet.Mvc (>= 6.0.0-beta1)
- Microsoft.Framework.ConfigurationModel.Json (>= 1.0.0-beta1)
- Microsoft.Framework.DependencyInjection (>= 1.0.0-beta1)
- System.Data.Common (>= 1.0.0-beta1)
GitHub repositories
This package is not used by any popular GitHub repositories.
Librame 5.0.1 (2015-01-19)
-- 新增 Librame.Context 命名空间;同时增加 ContextRepository'T3、ContextRepository'T2 统一上下文数据仓库封装类。
-- 调整 Librame.Controllers 命名空间所有类到 Librame.Context.Controllers 命名空间下;同时增加 ControllerBase'T2、ControllerRepositoryBase'T2、ControllerApiBase'T2等整数型相关控制器。
Example:
1. Models
public class Blog : Librame.Data.Models.IdEntity
{
public string Title { get; set; }
public string Description { get; set; }
public DateTime Pubdate { get; set; }
public Blog()
{
Pubdate = DateTime.Now;
}
}
public class TestDbContext : DbContext
{
protected override void OnModelCreating(ModelBuilder builder)
{
builder.Entity<Blog>(b =>
{
b.ForRelational().Table("Blogs");
b.Property(p => p.Id).GenerateValuesOnAdd();
b.Property(p => p.Title).Required().MaxLength(50);
b.Property(p => p.Description);
b.Property(p => p.Pubdate).Required();
b.Key(k => k.Id);
});
}
}
2. Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddEntityFramework(Configuration)
.AddSqlServer()
.AddDbContext<TestDbContext>();
services.AddMvc();
services.AddLibrame();
}
3. Controllers
public class BlogController : Librame.Context.Controllers.ControllerRepository<TestDbContext, Blog>
{
}
4. Request http://localhost/Blog
Response [{Id:1,...}]
5. Request http://localhost/Blog?take=10
Response {rows:[{Id:1,...}],total:100}
QQ Group: 112768263
Email: 312535437@qq.com