Df.EntityFrameworkCore.Oracle
1.2.0
See the version list below for details.
dotnet add package Df.EntityFrameworkCore.Oracle --version 1.2.0
NuGet\Install-Package Df.EntityFrameworkCore.Oracle -Version 1.2.0
<PackageReference Include="Df.EntityFrameworkCore.Oracle" Version="1.2.0" />
paket add Df.EntityFrameworkCore.Oracle --version 1.2.0
#r "nuget: Df.EntityFrameworkCore.Oracle, 1.2.0"
// Install Df.EntityFrameworkCore.Oracle as a Cake Addin #addin nuget:?package=Df.EntityFrameworkCore.Oracle&version=1.2.0 // Install Df.EntityFrameworkCore.Oracle as a Cake Tool #tool nuget:?package=Df.EntityFrameworkCore.Oracle&version=1.2.0
Df.EntityFrameworkCore.Oracle
Entity, Framework, EF, Core, Data, O/RM, entity-framework-core,Oracle
Df.EntityFrameworkCore.Oracle is an Entity Framework Core provider built on top of Oracle.ManagedDataAccess.Core. It allows us to use the Entity Framework Core ORM with Oracle. Async functions in this library properly implement Async I/O at the lowest level.
Getting Started
Here is a console application sample for accessing a Oracle database using Entity Framework:
② Put Df.EntityFrameworkCore.Oracle
into your project's .csproj
file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Df.EntityFrameworkCore.Oracle" Version="1.0.0" />
</ItemGroup>
</Project>
③ Implement some models, DbContext in Program.cs
. Then overriding the OnConfiguring of DbContext to use Oracle database. Besides. Finally to invoking Oracle with EF Core in your Main() method.
using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace OracleTest
{
public class User
{
public int UserId { get; set; }
[MaxLength(64)]
public string Name { get; set; }
}
public class Blog
{
public Guid Id { get; set; }
[MaxLength(32)]
public string Title { get; set; }
[ForeignKey("User")]
public int UserId { get; set; }
public virtual User User { get; set; }
public string Content { get; set; }
}
public class MyContext : DbContext
{
public DbSet<Blog> Blogs { get; set; }
public DbSet<User> Users { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
=> optionsBuilder
.UseOracle(@"DATA SOURCE=127.0.0.1:1521/tjims;PASSWORD=test;PERSIST SECURITY INFO=True;USER ID=test;");
}
public class Program
{
public static void Main()
{
using (var context = new MyContext())
{
// Create database
context.Database.EnsureCreated();
// Init sample data
var user = new User { Name = "Yuuko" };
context.Add(user);
var blog1 = new Blog {
Title = "Title #1",
UserId = user.UserId,
Tags = new List<string>() { "ASP.NET Core", "Oracle", "Df" }
};
context.Add(blog1);
var blog2 = new Blog
{
Title = "Title #2",
UserId = user.UserId,
Tags = new List<string>() { "ASP.NET Core", "Oracle" }
};
context.Add(blog2);
context.SaveChanges();
context.SaveChanges();
context.SaveChanges();
// Output data
var ret = context.Blogs
.Where(x => x.Tags.Object.Contains("Df"))
.ToList();
foreach (var x in ret)
{
Console.WriteLine($"{ x.Id } { x.Title }");
Console.WriteLine();
}
}
Console.Read();
}
}
}
Contribute
One of the easiest ways to contribute is to participate in discussions and discuss issues. You can also contribute by submitting pull requests with code changes.
License
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.EntityFrameworkCore.Relational (>= 2.2.6)
- Oracle.ManagedDataAccess.Core (>= 2.19.31)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
2019-09-25
- Forked project & made various fixes
- Fix paging issues
- Fix ORA-00972: identifier is too long
- Fix ORA-00918: column ambiguously defined