Attention! This repository will be merged with the FirebirdSql repository, intent is to unite all our efforts. The same will be officially integrated with FirebirdSQL in a few days!
Atenção! Este repositório será mesclado com o repositório FirebirdSql, a intenção é unir todos nossos esforços. O mesmo será integrado de forma Oficial com o FirebirdSQL em alguns dias!
Provider | Package name | Stable (master branch) |
On test (dev branch) |
---|---|---|---|
Firebird SQL | EntityFrameworkCore.FirebirdSQL |
The EntityFrameworkCore.FirebirdSQL is an Entity Framework Core access provider for Firebird SQL, compatible with version 3.X and earlier versions 2.x.
Same uses the ADO.NET Library Firebird Client written by friend Cincura.
All basic operations are working well
Insert ✔️ Update ✔️ Delete ✔️
Insert Bulk ✔️ Update Bulk ✔️ Delete Bulk ✔️
Includes ✔️ Complex Querys ✔️
Guid, TimeStamp, Date, BigInt, Varchar, Text
IDENTITY INCREMENT FOR FIREBIRD 3.X And 4.0 (Alpha)
//DataContext
public class BlogContext : DbContext
{
public DbSet<Blog> Blog { get; set; }
public DbSet<Post> Posts { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
string connectionString = "...";
optionsBuilder.UseFirebirdSql(connectionString);
}
protected override void OnModelCreating(ModelBuilder modelo)
{
//Fluent Api
modelo.Entity<Blog>(entity =>
{
entity.HasIndex(e => e.BlogId)
.HasName("Id")
.IsUnique();
});
}
}
public class Blog
{
public int BlogId { get; set; }
public string Url { get; set; }
public List<Post> Posts { get; set; }
}
public class Post
{
public int PostId { get; set; }
public string Title { get; set; }
public string Content { get; set; }
public int BlogId { get; set; }
public Blog Blog { get; set; }
}
}
//Sample Use
var cx = new BlogContext();
//one
cx.Blog.Add(new Blog
{
Url = "https://github.com/ralmsdeveloper/EntityFrameworkCore.FirebirdSQL"
});
cx.SaveChanges();
//Range
var RangeBlog = new List<Blog>
{
new Blog{ Url="https://github.com/ralmsdeveloper/EntityFrameworkCore.FirebirdSQL" },
new Blog{ Url="https://github.com/ralmsdeveloper/" },
new Blog{ Url="https://blog.ralms.net" },
new Blog{ Url="https://ralms.net" }
};
cx.Blog.AddRange(RangeBlog);
cx.SaveChanges();
//Sample Use
var cx = new BlogContext();
var blog = cx.Blog.Find(1);
cx.Attach(registro);
blog.Url = "www.ralms.net";
cx.SaveChanges();
//Sample Use
var cx = new BlogContext();
var blog = cx.Blog.Find(1);
cx.Delete(blog);
cx.SaveChanges();
//Sample Use
var cx = new BlogContext();
var blog = cx.Blog.Where(p => p.BlogId == 1).ToList();