123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- using System;
- using System.Collections.Generic;
- using Entities.Models;
- using Microsoft.EntityFrameworkCore;
- using Microsoft.EntityFrameworkCore.Metadata;
- namespace Entities
- {
- public partial class RepositoryContext : DbContext
- {
- public RepositoryContext()
- {
- }
- public RepositoryContext(DbContextOptions<RepositoryContext> options)
- : base(options)
- {
- }
- public virtual DbSet<BankAccountBalance> BankAccountBalances { get; set; } = null!;
- public virtual DbSet<BankOperation> BankOperations { get; set; } = null!;
- public virtual DbSet<Transaction> Transactions { get; set; } = null!;
- protected override void OnModelCreating(ModelBuilder modelBuilder)
- {
- modelBuilder.Entity<BankAccountBalance>(entity => {
- entity.ToTable("SK_BankAccountBalances", "SEPTEM");
- entity.HasIndex(e => e.BankAccountId, "IX_SK_BankAccountBalances_BankAccountId");
- entity.Property(e => e.Id).ValueGeneratedNever();
- entity.Property(e => e.Amount).HasPrecision(18, 3);
- entity.Property(e => e.BalanceType).HasMaxLength(50);
- });
- modelBuilder.Entity<BankOperation>(entity => {
- entity.ToTable("SK_BankOperations", "SEPTEM");
- entity.HasIndex(e => e.BankAccountId, "IX_SK_BankOperations_BankAccountId");
- entity.HasIndex(e => e.CashOperationTypeId, "IX_SK_BankOperations_CashOperationTypeId");
- entity.HasIndex(e => e.CustomerId, "IX_SK_BankOperations_CustomerId");
- entity.HasIndex(e => e.OperationPurposeId, "IX_SK_BankOperations_OperationPurposeId");
- entity.Property(e => e.Id).ValueGeneratedNever();
- entity.Property(e => e.AdvanceAmount).HasPrecision(18, 2);
- entity.Property(e => e.BalanceAmount).HasPrecision(18, 2);
- entity.Property(e => e.Code).HasMaxLength(50);
- entity.Property(e => e.CreatedDate).HasColumnType("timestamp without time zone");
- entity.Property(e => e.DocDate).HasColumnType("timestamp without time zone");
- entity.Property(e => e.IncomeAmount).HasPrecision(18, 2);
- entity.Property(e => e.ModifiedDate).HasColumnType("timestamp without time zone");
- entity.Property(e => e.Note).HasMaxLength(5000);
- entity.Property(e => e.OutcomeAmount).HasPrecision(18, 2);
- entity.Property(e => e.Purpose).HasMaxLength(150);
- entity.Property(e => e.Status).HasMaxLength(50);
- entity.Property(e => e.IsChanged).HasDefaultValue(false);
- });
- modelBuilder.Entity<Transaction>(entity => {
- entity.ToTable("SK_Transactions", "SEPTEM");
- entity.HasIndex(e => e.BankOperationId, "IX_SK_Transactions_BankOperationId");
- entity.Property(e => e.Id).ValueGeneratedNever();
- entity.Property(e => e.BalanceAmount).HasPrecision(18, 2);
- entity.Property(e => e.IncomeAmount).HasPrecision(18, 2);
- entity.Property(e => e.OutcomeAmount).HasPrecision(18, 2);
- entity.Property(e => e.ModifiedDate).HasColumnType("timestamp without time zone");
- entity.Property(e => e.CreateDate).HasColumnType("timestamp without time zone");
- entity.Property(e => e.OperationCreateDate).HasColumnType("timestamp without time zone");
- entity.HasIndex(e => e.BankAccountId, "IX_SK_Transactions_BankAccountId");
- entity.HasIndex(e => e.BusinessId);
- entity.HasOne(d => d.BankOperation)
- .WithMany(p => p.SkTransactions)
- .HasForeignKey(d => d.BankOperationId)
- .HasForeignKey(d => d.BankAccountId);
- });
- OnModelCreatingPartial(modelBuilder);
- }
- partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
- }
- }
|