FirebirdSQL database provider for Entity Framework Core.
Clone or download
Permalink
Failed to load latest commit information.
EFCore.FirebirdSql.FunctionalTests Fix #42 and Code Cleanup Oct 12, 2018
EFCore.FirebirdSql
EFCore.FirerbirdSql.ScaffoldTest Fix #42 and Code Cleanup Oct 12, 2018
.editorconfig
.gitattributes Adicionar .gitignore e .gitattributes. Aug 23, 2017
.gitignore Scaffolding fixes (#35) Jun 24, 2018
.travis.sources.list
.travis.yml Fix travis Oct 11, 2017
Directory.Build.props Fix nuget test Oct 18, 2017
EFCore.FirebirdSQL.sln
ISSUE_TEMPLATE.md
LICENSE
NuGet.Config
README.md Update README May 18, 2018
appveyor.yml Clean Key File! Feb 25, 2018
msbuild.binlog Update Urls Nuget.Config Mar 21, 2018

README.md

EntityFrameworkCore.FirebirdSql for Firebird Server

label GitHub license Travis build status AppVeyor build status

Provider Package name Stable (master branch) On test (dev branch)
Firebird SQL EntityFrameworkCore.FirebirdSql NuGet NuGet

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.

What we already have:

All basic operations are working well

Insert ✔️ Update ✔️ Delete ✔️

Insert Bulk ✔️ Update Bulk ✔️ Delete Bulk ✔️

Includes ✔️ Complex Querys ✔️

Supports:

Guid, TimeStamp, Date, BigInt, Varchar, Text

IDENTITY INCREMENT FOR FIREBIRD 3.X And 4.0 (Alpha)

Example of use DBContext

//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.UseFirebird(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; }
   }
}     

Example of use add

//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();

Example of use update

//Sample Use
 var cx = new BlogContext();  
  
 var blog = cx.Blog.Find(1);
 cx.Attach(blog);
 blog.Url = "www.ralms.net";
 cx.SaveChanges(); 

Example of use delete

//Sample Use
 var cx = new BlogContext();  
  
 var blog = cx.Blog.Find(1);
 cx.Delete(blog); 
 cx.SaveChanges(); 

Example of use where

//Sample Use
 var cx = new BlogContext();  
  
 var blogs = cx.Blog.Where(p => p.BlogId > 0).ToList();