Ejemplo n.º 1
0
        private static async Task CreateUserProfiles(OTRLSDbContext dbContext)
        {
            //local variables
            var createdDate = new DateTime(2016, 03, 01, 12, 30, 00);
            var updatedDate = DateTime.Now;


            var e = dbContext.CustomerProfile.Add(new CustomerProfile()
            {
                Tin           = "524354254",
                Gender        = 2,
                FirstName     = "ፈቲሀ",
                FirstNameEng  = "Fetiha",
                FatherName    = "ከድር",
                FatherNameEng = "Kedir",
                GrandName     = "ሁሴን",
                GrandNameEng  = "Hussien",
                MotherName    = "አሚና",
                MotherNameEng = "Amina",
                Nationality   = 49,
                AddressId     = 1,
                IsActive      = true,
                IsDeleted     = false,
                CreatedDate   = createdDate,
                UpdatedDate   = updatedDate,
            });
            //persist changes to Database
            await dbContext.SaveChangesAsync();
        }
Ejemplo n.º 2
0
        public static async Task Seed(OTRLSDbContext dbContext)
        {
            //create default Users (if there are none)



            //create default customer profile (if there are none)
            if (!dbContext.CustomerProfile.Any())
            {
                await CreateUserProfiles(dbContext);
            }
        }
Ejemplo n.º 3
0
 public ManagerRepository(OTRLSDbContext _context)
 {
     context = _context;
 }
Ejemplo n.º 4
0
 public LookUpTypeRepository(OTRLSDbContext _context)
 {
     context = _context;
 }
Ejemplo n.º 5
0
 public KebeleRepository(OTRLSDbContext _context, IDistributedCache _distributedCache, IConfiguration _configuration)
 {
     settings         = new Settings(_configuration);
     context          = _context;
     distributedCache = _distributedCache;
 }
Ejemplo n.º 6
0
 public CustomerProfileRepository(OTRLSDbContext context, IMapper mapper)
 {
     dbContext   = context;
     this.mapper = mapper;
 }