Ejemplo n.º 1
0
        public CitySQLRepository(CustomerAppDBContext ctx)
        {
            var configuration = new MapperConfiguration(cfg => {
                cfg.CreateMap <City, CitySql>().ConvertUsing(new CityToCitySqlConverter());
                cfg.CreateMap <CitySql, City>().ConvertUsing(new CitySqlToCityConverter());
            });

            configuration.AssertConfigurationIsValid();
            _mapper = configuration.CreateMapper();
            _ctx    = ctx;
        }
Ejemplo n.º 2
0
        public static void Seed(CustomerAppDBContext context)
        {
            context.Customers.Add(new Customer
            {
                Firstname = "Lars",
                Lastname  = "Bilde",
                Address   = "Uhhahahstrasse1",
                EMail     = "jumbaimba.org"
            }
                                  );

            context.SaveChanges();
        }
Ejemplo n.º 3
0
 public CustomerRepository(CustomerAppDBContext context) : base(context)
 {
 }
 public CustomerSQLRepository(CustomerAppDBContext ctx)
 {
     _ctx = ctx;
 }
 public AddressSQLRepository(CustomerAppDBContext ctx)
 {
     _ctx = ctx;
 }
 public CountryRepository(CustomerAppDBContext ctx)
 {
     _ctx = ctx;
 }
 public BaseRepository(CustomerAppDBContext context)
 {
     _context = context;
 }