public static List <Owner> GetAll() { var context = new RentalsContext(); var owners = context.Owners.ToList(); return(owners); }
public static Owner Find(int id) { var context = new RentalsContext(); var owner = context.Owners.Find(id); return(owner); }
public static void Add(PropertyType type) { var context = new RentalsContext(); context.PropertyTypes.Add(type); context.SaveChanges(); }
public static void Add(RentalProperty rental) { var context = new RentalsContext(); context.RentalProperties.Add(rental); context.SaveChanges(); }
public static List <PropertyType> GetAll() { var context = new RentalsContext(); var types = context.PropertyTypes.ToList(); return(types); }
public static List <RentalProperty> GetAll() { var context = new RentalsContext(); var rentals = context.RentalProperties.Include(r => r.Owner).Include(rp => rp.PropertyType).ToList(); return(rentals); }
public static List <RentalProperty> GetAll() { var context = new RentalsContext(); var rentals = context.Rentals.ToList(); return(rentals); }
public static void Add(Owner owner) { var context = new RentalsContext(); context.Owners.Add(owner); context.SaveChanges(); }
public static PropertyType Find(int id) { var context = new RentalsContext(); var type = context.PropertyTypes.Find(id); return(type); }
public static void Update(Owner owner) { var context = new RentalsContext(); var o = context.Owners.Find(owner.Id); o.Name = owner.Name; o.Phone = owner.Phone; context.SaveChanges(); }
public static List <RentalProperty> GetAllbyPropertyType(int id) { var context = new RentalsContext(); var rentals = context.RentalProperties. Where(prop => prop.PropertyTypeId == id).Include(r => r.Owner). Include(rp => rp.PropertyType).ToList(); return(rentals); }
public static IList GetAsKeyValuePairs() { var context = new RentalsContext(); var types = context.Owners.Select(o => new { o.Id, o.Name }).ToList(); return(types); }
public static IList GetAsKEyValuePairs() { var context = new RentalsContext(); var types = context.Renters.Select(o => new { Value = o.Id, Text = o.FirstName + " " + o.LastName }).ToList(); return(types); }
public static IList GetAsKeyValuePairs() { var context = new RentalsContext(); var types = context.PropertyTypes.Select(pt => new { pt.Id, pt.Style }).ToList(); return(types); }
public static IList GetAsKeyValuePairs() { var context = new RentalsContext(); var renters = context.Renters.Select(r => new { r.Id, FullName = $"{r.FirstName} {r.LastName}" }).ToList(); return(renters); }
public static IList GetAsKEyValuePairs() { var context = new RentalsContext(); var types = context.PropertyTypes.Select(o => new { Value = o.Id, Text = o.Style }).ToList(); return(types); }
public MoviesController(RentalsContext context) { _context = context; }
public RentalsController(RentalsContext rentalsContext) { _rentalsContext = rentalsContext; }
public CustomersController(RentalsContext context) { _context = context; }