public ListAnimalsQueryHandler(PetShopContext context) { _context = context; }
public static void SeedDB(PetShopContext ctx) { ctx.Database.EnsureDeleted(); ctx.Database.EnsureCreated(); var owner1 = ctx.Owners.Add(new Owner() { FirstName = "Lotte", LastName = "Tubæk", Address = "Rosenparken 53", Email = "*****@*****.**", PhoneNumber = "23313226" } ).Entity; var owner2 = ctx.Owners.Add(new Owner() { FirstName = "Mikael", LastName = "Fabrisous", Address = "Gammelmandvej 53", Email = "*****@*****.**", PhoneNumber = "2334334226" } ).Entity; var pet1 = ctx.Pets.Add(new Pet() { name = "Daniel", type = "Goat", color = "Ugly", price = 2400, previousOwner = owner1 }); var pet2 = ctx.Pets.Add(new Pet() { name = "Misser", type = "Hund", color = "Brun", price = 7699, previousOwner = owner2 }); string password = "******"; byte[] passwordHashJoe, passwordSaltJoe, passwordHashAnn, passwordSaltAnn; CreatePasswordHash(password, out passwordHashJoe, out passwordSaltJoe); CreatePasswordHash(password, out passwordHashAnn, out passwordSaltAnn); List <User> users = new List <User> { new User { Username = "******", PasswordHash = passwordHashJoe, PasswordSalt = passwordSaltJoe, IsAdmin = false }, new User { Username = "******", PasswordHash = passwordHashAnn, PasswordSalt = passwordSaltAnn, IsAdmin = true } }; ctx.Users.AddRange(users); ctx.SaveChanges(); }
public ColorRepository(PetShopContext ctx) { _ctx = ctx; }
static void Main() { PetShopContext context = new PetShopContext(); context.SaveChanges(); }
public PrincipalController(PetShopContext context) { _context = context; }
public SopstveniksController(PetShopContext context, IHostingEnvironment hostEnvironment) { _context = context; webHostEnvironment = hostEnvironment; }
public static void Seed(PetShopContext ctx) { Pet pet1 = new Pet { name = "Rex", type = PetTypes.Dog, birthDate = new DateTime(2017, 4, 20), soldDate = new DateTime(2017, 6, 25), color = "Brownish", price = 275, ownersHistory = new List <PetOwner>() }; Pet pet2 = new Pet { name = "Spoofy", type = PetTypes.Cat, birthDate = new DateTime(2018, 3, 10), soldDate = new DateTime(2018, 3, 30), color = "White and black", price = 550, ownersHistory = new List <PetOwner>() }; Owner owner1 = new Owner { firstName = "Simon", lastName = "Kjær", address = "Stengårdsvej 12", petHistory = new List <PetOwner>() }; Owner owner2 = new Owner { firstName = "Levis", lastName = "Kjongaard", address = "Hjertingvej 5", petHistory = new List <PetOwner>() }; owner1 = ctx.Owners.Add(owner1).Entity; owner2 = ctx.Owners.Add(owner2).Entity; PetOwner PetOwner1 = new PetOwner { Owner = owner1 }; PetOwner PetOwner2 = new PetOwner { Owner = owner2 }; PetOwner PetOwner3 = new PetOwner { Owner = owner1 }; pet1.ownersHistory.Add(PetOwner1); pet1.ownersHistory.Add(PetOwner2); pet2.ownersHistory.Add(PetOwner3); ctx.Pets.Add(pet1); ctx.Pets.Add(pet2); ctx.SaveChanges(); }
public PetRepository(PetShopContext context) { _context = context; }
public ShoppingCartController(PetShopContext context) { _context = context; }
public ListProductOrdersQueryHandler(PetShopContext context) { _context = context; }
public Repository(IConfiguration configuration, PetShopContext petShop) { AnimalsPerPage = configuration.GetValue("AnimalsPerPage", 6); this.petShop = petShop; }
public AccessoryCategoryController(PetShopContext context) { _context = context; }
public CompanyRepository(PetShopContext context) { _context = context; }
public CreateProductCommandHandler(PetShopContext context) { _context = context; }
public GetProductByIdQueryHandler(PetShopContext context) { _context = context; }
public OwnerRepository(PetShopContext context) { _context = context; }
public UpdateProductInfoCommandHandler(PetShopContext context) { _context = context; }
public FavoriteDAO(PetShopContext context) { _context = context; }
public TransactionController(PetShopContext context) { _context = context; }
public CreateCustomerCommandHandler(PetShopContext context) { _context = context; }
public ColorRepo(PetShopContext ctx) { this._ctx = ctx; }
public OwnerRepository(PetShopContext ctx) { _ctx = ctx; }
public UpdateCustomerInfoCommandHandler(PetShopContext context) { _context = context; }
public PetRepository(PetShopContext ctx) { _ctx = ctx; }
public OwnerRepo(PetShopContext ctx) { _ctx = ctx; }
public PetRepository(PetShopContext ctx, IOwnerService ownerService) { _ctx = ctx; _ownerService = ownerService; }
public UserRepository(PetShopContext context) { db = context; }