Files
oemanxTrader/OemanTrader.EntityFramework/OemanTraderDbContext.cs
2022-05-26 15:19:31 +02:00

27 lines
770 B
C#

using Microsoft.EntityFrameworkCore;
using OemanTrader.Domain.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OemanTrader.EntityFramework
{
public class OemanTraderDbContext : DbContext
{
public DbSet<User> Users { get; set; }
public DbSet<Account> Accounts { get; set; }
public DbSet<AssetTransaction> AssetTransactions { get; set; }
public OemanTraderDbContext(DbContextOptions options) : base(options) { }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<AssetTransaction>().OwnsOne(x => x.Asset);
base.OnModelCreating(modelBuilder);
}
}
}