using Azure.Core ;
using Biskilog_Accounting.Shared.Enums ;
using Biskilog_Accounting.Shared.Interfaces ;
using Biskilog_Accounting.Shared.POSModels ;
using Microsoft.EntityFrameworkCore ;
using Microsoft.Net.Http.Headers ;
using System.Security.Claims ;
namespace Biskilog_Accounting.Server.POSModels ;
public partial class BiskAcdbContext : DbContext
{
private readonly HttpContext m_httpContext ;
private readonly IConnectionService m_connection ;
private readonly ITokenService m_tokenService ;
public BiskAcdbContext ( )
{
}
public BiskAcdbContext ( DbContextOptions < BiskAcdbContext > options , ITokenService tokenService , IConnectionService connection , IHttpContextAccessor a_httpContextAccessor = null )
: base ( options )
{
m_tokenService = tokenService ;
m_connection = connection ;
m_httpContext = a_httpContextAccessor ? . HttpContext ;
}
protected override void OnConfiguring ( DbContextOptionsBuilder optionsBuilder )
{
if ( ! optionsBuilder . IsConfigured )
{
string token = m_httpContext . Request . Headers [ HeaderNames . Authorization ] ! ;
if ( AuthEnums . Valid = = m_tokenService . ValidateToken ( token ) )
{
int? databaseId = m_tokenService . GetDatabaseIdFromToken ( token ) ;
string connectionString = m_connection . GetClientConnectionString ( databaseId ! . Value ) ;
optionsBuilder . UseMySql ( connectionString , new MariaDbServerVersion ( new Version ( ) ) ) ;
}
else
{
m_httpContext . Abort ( ) ;
}
}
}
public virtual DbSet < Creditpurchase > Creditpurchases { get ; set ; }
public virtual DbSet < Customeraccount > Customeraccounts { get ; set ; }
public virtual DbSet < Productaltunit > Productaltunits { get ; set ; }
public virtual DbSet < Restocklevel > Restocklevels { get ; set ; }
public virtual DbSet < Systemuserrole > Systemuserroles { get ; set ; }
public virtual DbSet < Tblbranch > Tblbranches { get ; set ; }
public virtual DbSet < Tblbrand > Tblbrands { get ; set ; }
public virtual DbSet < Tblcancelledtransaction > Tblcancelledtransactions { get ; set ; }
public virtual DbSet < Tblcart > Tblcarts { get ; set ; }
public virtual DbSet < Tblcategory > Tblcategories { get ; set ; }
public virtual DbSet < Tblcompanydetail > Tblcompanydetails { get ; set ; }
public virtual DbSet < Tblcustomer > Tblcustomers { get ; set ; }
public virtual DbSet < Tblcustomerpurchase > Tblcustomerpurchases { get ; set ; }
public virtual DbSet < Tbldeliverydetail > Tbldeliverydetails { get ; set ; }
public virtual DbSet < Tbldeliveryhead > Tbldeliveryheads { get ; set ; }
public virtual DbSet < Tbldeliveryrecipient > Tbldeliveryrecipients { get ; set ; }
public virtual DbSet < Tbldiscountlog > Tbldiscountlogs { get ; set ; }
public virtual DbSet < Tbldriver > Tbldrivers { get ; set ; }
public virtual DbSet < Tblinventory > Tblinventories { get ; set ; }
public virtual DbSet < Tblinventoryentry > Tblinventoryentries { get ; set ; }
public virtual DbSet < Tblinvoice > Tblinvoices { get ; set ; }
public virtual DbSet < Tblpricechange > Tblpricechanges { get ; set ; }
public virtual DbSet < Tblproduct > Tblproducts { get ; set ; }
public virtual DbSet < Tbltruck > Tbltrucks { get ; set ; }
public virtual DbSet < TbltruckDrivermapping > TbltruckDrivermappings { get ; set ; }
public virtual DbSet < Tbltruckassignment > Tbltruckassignments { get ; set ; }
public virtual DbSet < Tbltruckinventory > Tbltruckinventories { get ; set ; }
public virtual DbSet < Tbluser > Tblusers { get ; set ; }
public virtual DbSet < Tbstock > Tbstocks { get ; set ; }
public virtual DbSet < Unitofmeasure > Unitofmeasures { get ; set ; }
protected override void OnModelCreating ( ModelBuilder modelBuilder )
{
modelBuilder
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
modelBuilder . Entity < Creditpurchase > ( entity = >
{
entity . HasKey ( e = > new { e . ReceiptId , e . BranchId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "creditpurchases" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . ReceiptId )
. HasMaxLength ( 1 2 0 )
. HasColumnName ( "receiptID" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. HasDefaultValueSql ( "'0'" )
. IsFixedLength ( )
. HasColumnName ( "branchID" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . CustomerId )
. HasMaxLength ( 1 2 0 )
. HasDefaultValueSql ( "'0'" )
. HasColumnName ( "customerID" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Date )
. ValueGeneratedOnAddOrUpdate ( )
. HasDefaultValueSql ( "current_timestamp()" )
. HasColumnType ( "timestamp" )
. HasColumnName ( "date" ) ;
entity . Property ( e = > e . Paid )
. HasPrecision ( 1 9 , 2 )
. HasColumnName ( "paid" ) ;
entity . Property ( e = > e . Status )
. HasMaxLength ( 1 0 )
. HasDefaultValueSql ( "'0'" )
. IsFixedLength ( )
. HasColumnName ( "status" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . TotalBill )
. HasPrecision ( 1 9 , 2 )
. HasColumnName ( "totalBill" ) ;
} ) ;
modelBuilder . Entity < Customeraccount > ( entity = >
{
entity . HasKey ( e = > new { e . BranchId , e . CountId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "customeraccounts" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. HasDefaultValueSql ( "''" )
. IsFixedLength ( )
. HasColumnName ( "branchID" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . CountId )
. HasMaxLength ( 1 2 0 )
. HasDefaultValueSql ( "''" )
. HasColumnName ( "countID" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Balance )
. HasPrecision ( 1 9 , 2 )
. HasColumnName ( "balance" ) ;
entity . Property ( e = > e . Comments )
. HasColumnType ( "text" )
. HasColumnName ( "comments" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Credit )
. HasPrecision ( 1 9 , 2 )
. HasColumnName ( "credit" ) ;
entity . Property ( e = > e . CustomerId )
. HasMaxLength ( 1 2 0 )
. HasColumnName ( "customerID" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Date )
. ValueGeneratedOnAddOrUpdate ( )
. HasDefaultValueSql ( "current_timestamp()" )
. HasColumnType ( "timestamp" )
. HasColumnName ( "date" ) ;
entity . Property ( e = > e . Debit )
. HasPrecision ( 1 9 , 2 )
. HasColumnName ( "debit" ) ;
entity . Property ( e = > e . TransactionId )
. HasMaxLength ( 1 2 0 )
. HasColumnName ( "transactionID" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
} ) ;
modelBuilder . Entity < Productaltunit > ( entity = >
{
entity . HasKey ( e = > new { e . DistinctiveCode , e . BranchId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "productaltunit" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . DistinctiveCode )
. HasMaxLength ( 1 2 0 )
. HasColumnName ( "distinctiveCode" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 2 0 )
. HasColumnName ( "branchID" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Pcode )
. HasMaxLength ( 1 2 0 )
. HasColumnName ( "pcode" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . PriceUnit )
. HasPrecision ( 1 9 , 2 )
. HasColumnName ( "price/unit" ) ;
entity . Property ( e = > e . QuantityUnit )
. HasColumnType ( "int(11)" )
. HasColumnName ( "quantity/unit" ) ;
entity . Property ( e = > e . UnitBarcode )
. HasMaxLength ( 2 0 )
. HasColumnName ( "unitBarcode" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . UnitCode )
. HasMaxLength ( 1 2 0 )
. HasColumnName ( "unitCode" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
} ) ;
modelBuilder . Entity < Restocklevel > ( entity = >
{
entity . HasKey ( e = > new { e . ProductId , e . BranchId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "restocklevels" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . ProductId )
. HasMaxLength ( 1 5 0 )
. HasColumnName ( "productID" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 2 0 )
. HasColumnName ( "branchID" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Unit )
. HasMaxLength ( 1 5 0 )
. HasColumnName ( "unit" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . WarnLevel )
. HasColumnType ( "int(11)" )
. HasColumnName ( "warnLevel" ) ;
} ) ;
modelBuilder . Entity < Systemuserrole > ( entity = >
{
entity . HasKey ( e = > e . Id ) . HasName ( "PRIMARY" ) ;
entity
. ToTable ( "systemuserroles" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . Id )
. ValueGeneratedNever ( )
. HasColumnType ( "int(11)" )
. HasColumnName ( "id" ) ;
entity . Property ( e = > e . Assist )
. HasColumnType ( "tinyint(4)" )
. HasColumnName ( "assist" ) ;
entity . Property ( e = > e . Cashier )
. HasColumnType ( "tinyint(4)" )
. HasColumnName ( "cashier" ) ;
entity . Property ( e = > e . Manager )
. HasColumnType ( "tinyint(4)" )
. HasColumnName ( "manager" ) ;
entity . Property ( e = > e . Owner )
. HasColumnType ( "tinyint(4)" )
. HasColumnName ( "owner" ) ;
entity . Property ( e = > e . Roles )
. HasColumnName ( "roles" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
} ) ;
modelBuilder . Entity < Tblbranch > ( entity = >
{
entity . HasKey ( e = > e . BranchId ) . HasName ( "PRIMARY" ) ;
entity
. ToTable ( "tblbranches" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 2 )
. HasColumnName ( "branchID" ) ;
entity . Property ( e = > e . Address )
. HasMaxLength ( 5 0 )
. HasColumnName ( "address" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . BranchName )
. HasMaxLength ( 5 0 )
. HasColumnName ( "branchName" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . BranchTelephone )
. HasMaxLength ( 5 0 )
. HasColumnName ( "branch_telephone" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . City )
. HasMaxLength ( 5 0 )
. HasColumnName ( "city" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . StateOrProvince )
. HasMaxLength ( 5 0 )
. HasColumnName ( "state_or_province" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
} ) ;
modelBuilder . Entity < Tblbrand > ( entity = >
{
entity . HasKey ( e = > new { e . Id , e . BranchId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tblbrand" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . Id )
. HasMaxLength ( 5 0 )
. HasColumnName ( "id" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 2 )
. HasColumnName ( "branchID" ) ;
entity . Property ( e = > e . Brand )
. HasMaxLength ( 5 0 )
. HasColumnName ( "brand" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
} ) ;
modelBuilder . Entity < Tblcancelledtransaction > ( entity = >
{
entity . HasKey ( e = > new { e . BranchId , e . CountId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tblcancelledtransactions" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 5 0 )
. HasColumnName ( "branchID" ) ;
entity . Property ( e = > e . CountId )
. HasMaxLength ( 5 0 )
. HasColumnName ( "countID" ) ;
entity . Property ( e = > e . CancelledBy )
. HasMaxLength ( 5 0 )
. HasColumnName ( "cancelledBy" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . DateCancelled )
. HasColumnType ( "timestamp" )
. HasColumnName ( "dateCancelled" ) ;
entity . Property ( e = > e . Transno )
. HasColumnName ( "transno" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
} ) ;
modelBuilder . Entity < Tblcart > ( entity = >
{
entity . HasKey ( e = > new { e . BranchId , e . CountId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tblcart" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. HasDefaultValueSql ( "''" )
. IsFixedLength ( )
. HasColumnName ( "branchID" ) ;
entity . Property ( e = > e . CountId )
. HasMaxLength ( 2 0 0 )
. HasColumnName ( "countID" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Cashier )
. HasMaxLength ( 5 0 )
. HasColumnName ( "cashier" ) ;
entity . Property ( e = > e . Costprice )
. HasPrecision ( 1 9 , 2 )
. HasColumnName ( "costprice" ) ;
entity . Property ( e = > e . Date )
. HasColumnType ( "timestamp" )
. HasColumnName ( "date" ) ;
entity . Property ( e = > e . Id )
. HasMaxLength ( 5 0 )
. HasColumnName ( "id" ) ;
entity . Property ( e = > e . Price )
. HasPrecision ( 1 9 , 2 )
. HasColumnName ( "price" ) ;
entity . Property ( e = > e . Quantity )
. HasColumnType ( "int(11)" )
. HasColumnName ( "quantity" ) ;
entity . Property ( e = > e . Status )
. HasMaxLength ( 5 0 )
. HasColumnName ( "status" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Total )
. HasPrecision ( 1 9 , 2 )
. HasColumnName ( "total" ) ;
entity . Property ( e = > e . Transno )
. HasColumnName ( "transno" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Unit )
. HasMaxLength ( 1 2 0 )
. HasColumnName ( "unit" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
} ) ;
modelBuilder . Entity < Tblcategory > ( entity = >
{
entity . HasKey ( e = > new { e . Id , e . BranchId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tblcategory" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . Id )
. HasMaxLength ( 5 0 )
. HasColumnName ( "id" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 2 )
. HasColumnName ( "branchID" ) ;
entity . Property ( e = > e . Category )
. HasMaxLength ( 5 0 )
. HasColumnName ( "category" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
} ) ;
modelBuilder . Entity < Tblcompanydetail > ( entity = >
{
entity . HasKey ( e = > e . Tin ) . HasName ( "PRIMARY" ) ;
entity
. ToTable ( "tblcompanydetails" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . Tin )
. HasMaxLength ( 6 0 )
. HasColumnName ( "tin" ) ;
entity . Property ( e = > e . Address )
. HasMaxLength ( 5 0 )
. HasColumnName ( "address" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . CompanyName )
. HasMaxLength ( 5 0 )
. HasColumnName ( "company_name" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Email )
. HasMaxLength ( 5 0 )
. HasColumnName ( "email" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . MainTelephone )
. HasMaxLength ( 5 0 )
. HasColumnName ( "main_telephone" ) ;
entity . Property ( e = > e . Vatno )
. HasMaxLength ( 6 0 )
. HasColumnName ( "vatno" ) ;
entity . Property ( e = > e . Website )
. HasMaxLength ( 5 0 )
. HasColumnName ( "website" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
} ) ;
modelBuilder . Entity < Tblcustomer > ( entity = >
{
entity . HasKey ( e = > new { e . CustomerId , e . BranchId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tblcustomers" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . CustomerId )
. HasMaxLength ( 3 0 )
. HasColumnName ( "customerID" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. HasDefaultValueSql ( "''" )
. IsFixedLength ( )
. HasColumnName ( "branchID" ) ;
entity . Property ( e = > e . Address )
. HasMaxLength ( 5 0 )
. HasColumnName ( "address" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . DateAdded )
. HasColumnType ( "timestamp" )
. HasColumnName ( "dateAdded" ) ;
entity . Property ( e = > e . DateExit )
. HasColumnType ( "timestamp" )
. HasColumnName ( "dateExit" ) ;
entity . Property ( e = > e . Email )
. HasMaxLength ( 5 0 )
. HasColumnName ( "email" ) ;
entity . Property ( e = > e . FinancialStatus )
. HasMaxLength ( 2 0 )
. HasColumnName ( "financialStatus" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Firstname )
. HasMaxLength ( 5 0 )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . NameKey1 )
. HasMaxLength ( 1 2 0 )
. HasColumnName ( "name_key1" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . NameKey2 )
. HasMaxLength ( 1 2 0 )
. HasColumnName ( "name_key2" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Status )
. HasMaxLength ( 2 0 )
. HasColumnName ( "status" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Surname )
. HasMaxLength ( 5 0 )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Telephone )
. HasMaxLength ( 5 0 )
. HasColumnName ( "telephone" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Tin )
. HasMaxLength ( 5 0 )
. HasColumnName ( "tin" ) ;
} ) ;
modelBuilder . Entity < Tblcustomerpurchase > ( entity = >
{
entity . HasKey ( e = > new { e . BranchId , e . CountId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tblcustomerpurchases" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. HasDefaultValueSql ( "''" )
. IsFixedLength ( )
. HasColumnName ( "branchID" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . CountId )
. HasMaxLength ( 5 0 )
. HasColumnName ( "countID" ) ;
entity . Property ( e = > e . CustomerId )
. HasMaxLength ( 5 0 )
. HasColumnName ( "customerID" ) ;
entity . Property ( e = > e . TransactionId )
. HasMaxLength ( 5 0 )
. HasColumnName ( "transactionID" ) ;
} ) ;
modelBuilder . Entity < Tbldeliverydetail > ( entity = >
{
entity . HasKey ( e = > new { e . CountId , e . BranchId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tbldeliverydetails" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . CountId )
. HasMaxLength ( 1 0 0 )
. HasColumnName ( "countID" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. IsFixedLength ( )
. HasColumnName ( "branchID" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Cost )
. HasPrecision ( 1 9 , 2 )
. HasColumnName ( "cost" ) ;
entity . Property ( e = > e . DeliveryId )
. HasMaxLength ( 6 0 )
. HasColumnName ( "deliveryID" ) ;
entity . Property ( e = > e . Pcode )
. HasMaxLength ( 6 0 )
. HasColumnName ( "pcode" ) ;
entity . Property ( e = > e . Quantity )
. HasColumnType ( "int(11)" )
. HasColumnName ( "quantity" ) ;
entity . Property ( e = > e . Unit )
. HasMaxLength ( 1 2 0 )
. HasColumnName ( "unit" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
} ) ;
modelBuilder . Entity < Tbldeliveryhead > ( entity = >
{
entity . HasKey ( e = > new { e . DeliveryId , e . BranchId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tbldeliveryhead" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . DeliveryId )
. HasMaxLength ( 6 0 )
. HasColumnName ( "deliveryID" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. IsFixedLength ( )
. HasColumnName ( "branchID" ) ;
entity . Property ( e = > e . CustomerId )
. HasMaxLength ( 6 0 )
. HasColumnName ( "customerID" ) ;
entity . Property ( e = > e . DateCompleted )
. HasMaxLength ( 6 )
. HasColumnName ( "dateCompleted" ) ;
entity . Property ( e = > e . DateInitiated )
. HasMaxLength ( 6 )
. HasColumnName ( "dateInitiated" ) ;
entity . Property ( e = > e . Destination )
. HasMaxLength ( 6 0 )
. HasColumnName ( "destination" ) ;
entity . Property ( e = > e . GeneratedBy )
. HasMaxLength ( 5 0 )
. HasColumnName ( "generatedBy" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Status )
. HasMaxLength ( 2 0 )
. HasColumnName ( "status" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . TotalCost )
. HasPrecision ( 1 9 , 2 )
. HasColumnName ( "totalCost" ) ;
} ) ;
modelBuilder . Entity < Tbldeliveryrecipient > ( entity = >
{
entity . HasKey ( e = > new { e . DeliveryId , e . BranchId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tbldeliveryrecipients" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . DeliveryId )
. HasMaxLength ( 6 0 )
. HasColumnName ( "deliveryID" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. IsFixedLength ( )
. HasColumnName ( "branchID" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Address )
. HasMaxLength ( 6 0 )
. HasColumnName ( "address" ) ;
entity . Property ( e = > e . CustomerId )
. HasMaxLength ( 6 0 )
. HasColumnName ( "customerID" ) ;
entity . Property ( e = > e . Email )
. HasMaxLength ( 6 0 )
. HasColumnName ( "email" ) ;
entity . Property ( e = > e . FromDate ) . HasColumnName ( "fromDate" ) ;
entity . Property ( e = > e . Fullname )
. HasColumnName ( "fullname" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Telephone )
. HasMaxLength ( 1 5 )
. HasColumnName ( "telephone" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . ToDate ) . HasColumnName ( "toDate" ) ;
} ) ;
modelBuilder . Entity < Tbldiscountlog > ( entity = >
{
entity . HasKey ( e = > new { e . BranchId , e . CountId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tbldiscountlogs" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. IsFixedLength ( )
. HasColumnName ( "branchID" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . CountId )
. HasMaxLength ( 1 5 0 )
. HasDefaultValueSql ( "''" )
. HasColumnName ( "countID" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Cashier )
. HasMaxLength ( 5 0 )
. HasColumnName ( "cashier" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Date )
. HasMaxLength ( 6 )
. HasColumnName ( "date" ) ;
entity . Property ( e = > e . Discount )
. HasPrecision ( 1 9 , 2 )
. HasColumnName ( "discount" ) ;
entity . Property ( e = > e . ReceiptId )
. HasMaxLength ( 5 0 )
. HasColumnName ( "receiptID" ) ;
} ) ;
modelBuilder . Entity < Tbldriver > ( entity = >
{
entity . HasKey ( e = > new { e . DriverId , e . BranchId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tbldrivers" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . DriverId )
. HasMaxLength ( 5 0 )
. HasColumnName ( "driverID" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. HasDefaultValueSql ( "''" )
. IsFixedLength ( )
. HasColumnName ( "branchID" ) ;
entity . Property ( e = > e . Address1 )
. HasMaxLength ( 5 0 )
. HasColumnName ( "address1" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Address2 )
. HasMaxLength ( 5 0 )
. HasColumnName ( "address2" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . City )
. HasMaxLength ( 5 0 )
. HasColumnName ( "city" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . DateOfBirth ) . HasColumnName ( "dateOfBirth" ) ;
entity . Property ( e = > e . Email )
. HasMaxLength ( 1 2 0 )
. HasColumnName ( "email" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Firstname )
. HasMaxLength ( 5 0 )
. HasColumnName ( "firstname" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Middlename )
. HasMaxLength ( 5 0 )
. HasColumnName ( "middlename" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . State )
. HasMaxLength ( 5 0 )
. HasColumnName ( "state" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Status )
. HasMaxLength ( 5 0 )
. HasColumnName ( "status" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Surname )
. HasMaxLength ( 5 0 )
. HasColumnName ( "surname" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Telephone )
. HasMaxLength ( 2 0 )
. HasColumnName ( "telephone" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
} ) ;
modelBuilder . Entity < Tblinventory > ( entity = >
{
entity . HasKey ( e = > new { e . BranchId , e . CountId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tblinventory" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. HasDefaultValueSql ( "''" )
. IsFixedLength ( )
. HasColumnName ( "branchID" ) ;
entity . Property ( e = > e . CountId )
. HasMaxLength ( 5 0 )
. HasColumnName ( "countID" ) ;
entity . Property ( e = > e . Pcode )
. HasMaxLength ( 5 0 )
. HasColumnName ( "pcode" ) ;
entity . Property ( e = > e . Quantity )
. HasColumnType ( "int(11)" )
. HasColumnName ( "quantity" ) ;
} ) ;
modelBuilder . Entity < Tblinventoryentry > ( entity = >
{
entity . HasKey ( e = > new { e . CountId , e . BranchId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tblinventoryentries" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . CountId )
. HasMaxLength ( 1 2 0 )
. HasColumnName ( "countID" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. IsFixedLength ( )
. HasColumnName ( "branchID" ) ;
entity . Property ( e = > e . Date )
. HasMaxLength ( 6 )
. HasColumnName ( "date" ) ;
entity . Property ( e = > e . Pcode )
. HasMaxLength ( 5 0 )
. HasColumnName ( "pcode" ) ;
entity . Property ( e = > e . Quantity )
. HasColumnType ( "int(11)" )
. HasColumnName ( "quantity" ) ;
} ) ;
modelBuilder . Entity < Tblinvoice > ( entity = >
{
entity . HasKey ( e = > new { e . CountId , e . BranchId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tblinvoice" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . CountId )
. HasMaxLength ( 5 0 )
. HasColumnName ( "countID" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. HasDefaultValueSql ( "''" )
. IsFixedLength ( )
. HasColumnName ( "branchID" ) ;
entity . Property ( e = > e . DateGenerated ) . HasColumnName ( "dateGenerated" ) ;
entity . Property ( e = > e . GeneratedBy )
. HasMaxLength ( 5 0 )
. HasColumnName ( "generatedBy" ) ;
entity . Property ( e = > e . InvoiceId )
. HasMaxLength ( 6 0 )
. HasColumnName ( "invoiceID" ) ;
entity . Property ( e = > e . Pcode )
. HasMaxLength ( 5 0 )
. HasColumnName ( "pcode" ) ;
entity . Property ( e = > e . Quantity )
. HasColumnType ( "int(11)" )
. HasColumnName ( "quantity" ) ;
entity . Property ( e = > e . Status )
. HasMaxLength ( 1 6 )
. HasColumnName ( "status" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Totalprice )
. HasPrecision ( 1 9 , 2 )
. HasColumnName ( "totalprice" ) ;
entity . Property ( e = > e . Unit )
. HasMaxLength ( 1 2 0 )
. HasColumnName ( "unit" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Unitprice )
. HasPrecision ( 1 9 , 2 )
. HasColumnName ( "unitprice" ) ;
} ) ;
modelBuilder . Entity < Tblpricechange > ( entity = >
{
entity . HasKey ( e = > new { e . CountId , e . BranchId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tblpricechanges" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . CountId )
. HasMaxLength ( 7 0 )
. HasColumnName ( "countID" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. IsFixedLength ( )
. HasColumnName ( "branchID" ) ;
entity . Property ( e = > e . ChangeDate )
. HasMaxLength ( 6 )
. HasColumnName ( "change_date" ) ;
entity . Property ( e = > e . CurrentPrice )
. HasPrecision ( 1 9 , 2 )
. HasColumnName ( "current_price" ) ;
entity . Property ( e = > e . Pcode )
. HasMaxLength ( 1 2 0 )
. HasColumnName ( "pcode" ) ;
entity . Property ( e = > e . PreviousPrice )
. HasPrecision ( 1 9 , 2 )
. HasColumnName ( "previous_price" ) ;
} ) ;
modelBuilder . Entity < Tblproduct > ( entity = >
{
entity . HasKey ( e = > new { e . CountId , e . BranchId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tblproduct" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . CountId )
. HasMaxLength ( 5 0 )
. HasColumnName ( "countID" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. IsFixedLength ( )
. HasColumnName ( "branchID" ) ;
entity . Property ( e = > e . Barcode )
. HasMaxLength ( 5 0 )
. HasColumnName ( "barcode" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . BaseUnit )
. HasMaxLength ( 1 2 0 )
. HasColumnName ( "baseUnit" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Bid )
. HasMaxLength ( 5 0 )
. HasColumnName ( "bid" ) ;
entity . Property ( e = > e . Cid )
. HasMaxLength ( 5 0 )
. HasColumnName ( "cid" ) ;
entity . Property ( e = > e . Costprice )
. HasPrecision ( 1 9 , 2 )
. HasColumnName ( "costprice" ) ;
entity . Property ( e = > e . Pcode )
. HasMaxLength ( 5 0 )
. HasColumnName ( "pcode" ) ;
entity . Property ( e = > e . Pdesc )
. HasColumnName ( "pdesc" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Price )
. HasPrecision ( 1 9 , 2 )
. HasColumnName ( "price" ) ;
entity . Property ( e = > e . ProductName )
. HasColumnName ( "product_name" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Status )
. HasMaxLength ( 2 0 )
. HasColumnName ( "status" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
} ) ;
modelBuilder . Entity < Tbltruck > ( entity = >
{
entity . HasKey ( e = > new { e . TruckId , e . BranchId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tbltrucks" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . TruckId )
. HasMaxLength ( 6 0 )
. HasColumnName ( "truckID" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. IsFixedLength ( )
. HasColumnName ( "branchID" ) ;
entity . Property ( e = > e . Brand )
. HasMaxLength ( 5 0 )
. HasColumnName ( "brand" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Driver )
. HasMaxLength ( 5 0 )
. HasColumnName ( "driver" ) ;
entity . Property ( e = > e . LicensePlate )
. HasMaxLength ( 6 0 )
. HasColumnName ( "licensePlate" ) ;
entity . Property ( e = > e . Weight )
. HasPrecision ( 1 9 , 2 )
. HasColumnName ( "weight" ) ;
} ) ;
modelBuilder . Entity < TbltruckDrivermapping > ( entity = >
{
entity . HasKey ( e = > new { e . CountId , e . BranchId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tbltruck_drivermapping" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . CountId )
. HasMaxLength ( 6 0 )
. HasColumnName ( "countID" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. IsFixedLength ( )
. HasColumnName ( "branchID" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . DateEntry )
. HasMaxLength ( 6 )
. HasColumnName ( "dateEntry" ) ;
entity . Property ( e = > e . DriverId )
. HasMaxLength ( 5 0 )
. HasColumnName ( "driverID" ) ;
entity . Property ( e = > e . Operation )
. HasMaxLength ( 5 0 )
. HasColumnName ( "operation" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . TruckId )
. HasMaxLength ( 5 0 )
. HasColumnName ( "truckID" ) ;
} ) ;
modelBuilder . Entity < Tbltruckassignment > ( entity = >
{
entity . HasKey ( e = > new { e . CountId , e . BranchId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tbltruckassignments" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . CountId )
. HasMaxLength ( 1 0 0 )
. HasColumnName ( "countID" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. IsFixedLength ( )
. HasColumnName ( "branchID" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Cost )
. HasPrecision ( 1 9 , 2 )
. HasColumnName ( "cost" ) ;
entity . Property ( e = > e . DateAssigned )
. HasMaxLength ( 6 )
. HasColumnName ( "dateAssigned" ) ;
entity . Property ( e = > e . OrderId )
. HasMaxLength ( 5 0 )
. HasColumnName ( "orderID" ) ;
entity . Property ( e = > e . Status )
. HasMaxLength ( 5 0 )
. HasColumnName ( "status" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . TruckId )
. HasMaxLength ( 5 0 )
. HasColumnName ( "truckID" ) ;
} ) ;
modelBuilder . Entity < Tbltruckinventory > ( entity = >
{
entity . HasKey ( e = > new { e . CountId , e . BranchId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tbltruckinventory" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . CountId )
. HasMaxLength ( 5 0 )
. HasColumnName ( "countID" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. IsFixedLength ( )
. HasColumnName ( "branchID" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Pcode )
. HasMaxLength ( 5 0 )
. HasColumnName ( "pcode" ) ;
entity . Property ( e = > e . Quantity )
. HasColumnType ( "int(11)" )
. HasColumnName ( "quantity" ) ;
entity . Property ( e = > e . TruckId )
. HasMaxLength ( 5 0 )
. HasColumnName ( "truckID" ) ;
entity . Property ( e = > e . Unit )
. HasMaxLength ( 1 2 0 )
. HasColumnName ( "unit" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
} ) ;
modelBuilder . Entity < Tbluser > ( entity = >
{
entity . HasKey ( e = > new { e . Username , e . BranchId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tblusers" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . Username )
. HasMaxLength ( 5 0 )
. HasColumnName ( "username" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. HasDefaultValueSql ( "''" )
. IsFixedLength ( )
. HasColumnName ( "branchID" ) ;
entity . Property ( e = > e . AccessLevel )
. HasMaxLength ( 1 0 )
. HasColumnName ( "access_level" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . City )
. HasMaxLength ( 5 0 )
. HasColumnName ( "city" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Email )
. HasMaxLength ( 5 0 )
. HasColumnName ( "email" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Firstname )
. HasMaxLength ( 5 0 )
. HasColumnName ( "firstname" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . LastLogin )
. HasMaxLength ( 6 )
. HasColumnName ( "last_login" ) ;
entity . Property ( e = > e . Password )
. HasColumnName ( "password" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . StateOrProvince )
. HasMaxLength ( 5 0 )
. HasColumnName ( "state_or_province" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . StreetAddress1 )
. HasMaxLength ( 5 0 )
. HasColumnName ( "street_address1" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . StreetAddress2 )
. HasMaxLength ( 5 0 )
. HasColumnName ( "street_address2" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Surname )
. HasMaxLength ( 5 0 )
. HasColumnName ( "surname" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Telephone )
. HasMaxLength ( 1 5 )
. HasColumnName ( "telephone" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
} ) ;
modelBuilder . Entity < Tbstock > ( entity = >
{
entity . HasKey ( e = > new { e . CountId , e . BranchId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "tbstock" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . CountId )
. HasMaxLength ( 5 0 )
. HasColumnName ( "countID" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. IsFixedLength ( )
. HasColumnName ( "branchID" ) ;
entity . Property ( e = > e . Pcode )
. HasMaxLength ( 5 0 )
. HasColumnName ( "pcode" ) ;
entity . Property ( e = > e . Qty )
. HasColumnType ( "int(11)" )
. HasColumnName ( "qty" ) ;
entity . Property ( e = > e . Refno )
. HasMaxLength ( 5 0 )
. HasColumnName ( "refno" ) ;
entity . Property ( e = > e . Sdate ) . HasColumnName ( "sdate" ) ;
entity . Property ( e = > e . Stockinby )
. HasMaxLength ( 5 0 )
. HasColumnName ( "stockinby" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
} ) ;
modelBuilder . Entity < Unitofmeasure > ( entity = >
{
entity . HasKey ( e = > new { e . UnitCode , e . BranchId } )
. HasName ( "PRIMARY" )
. HasAnnotation ( "MySql:IndexPrefixLength" , new [ ] { 0 , 0 } ) ;
entity
. ToTable ( "unitofmeasure" )
. HasCharSet ( "utf8" )
. UseCollation ( "utf8_general_ci" ) ;
entity . Property ( e = > e . UnitCode )
. HasMaxLength ( 1 2 0 )
. HasColumnName ( "unitCode" ) ;
entity . Property ( e = > e . BranchId )
. HasMaxLength ( 1 0 )
. HasDefaultValueSql ( "''" )
. IsFixedLength ( )
. HasColumnName ( "branchID" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Status )
. HasMaxLength ( 5 0 )
. HasColumnName ( "status" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Unitname )
. HasMaxLength ( 1 2 0 )
. HasColumnName ( "unitname" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
entity . Property ( e = > e . Unitshort )
. HasMaxLength ( 1 2 0 )
. HasColumnName ( "unitshort" )
. UseCollation ( "utf8mb4_general_ci" )
. HasCharSet ( "utf8mb4" ) ;
} ) ;
OnModelCreatingPartial ( modelBuilder ) ;
}
partial void OnModelCreatingPartial ( ModelBuilder modelBuilder ) ;
}