public virtual void Update(T entity) { using (RentaCarContext context = new RentaCarContext()) { var deleteEntity = context.Entry(entity); deleteEntity.State = EntityState.Deleted; context.SaveChanges(); } }
public List <T> GetAll(Expression <Func <T, bool> > filter = null) { using (RentaCarContext context = new RentaCarContext()) { return(filter == null? context.Set <T>().ToList() : context.Set <T>().Where(filter).ToList()); } }
public virtual void Add(T entity) { using (RentaCarContext context = new RentaCarContext()) { var addedEntity = context.Entry(entity); addedEntity.State = EntityState.Added; context.SaveChanges(); } }
private bool CheckId(int id) { RentaCarContext context = new RentaCarContext(); var result = context.UserFindex.Where(u => u.UserId == id).Any(); if (result) { return(false); } return(true); }
private bool CheckColorId(int id) { RentaCarContext context = new RentaCarContext(); var result = context.Colors.Where(c => c.ColorId == id).Any(); if (result) { return(false); } return(true); }
private bool CheckBrandId(int id) { RentaCarContext context = new RentaCarContext(); var check = context.Brands.Where(b => b.BrandId == id).Any(); if (check) { return(false); } else { return(true); } }
public BaseService(RentaCarContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public static void Seed(RentaCarContext context) { context.Database.EnsureCreated(); }
public CustomerService(RentaCarContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public VehicleModelService(RentaCarContext context, IMapper mapper) : base(context, mapper) { }
public BranchService(RentaCarContext context, IMapper mapper) : base(context, mapper) { }
public UnitofWork() { _context = new RentaCarContext(); }
public BaseCRUDService(RentaCarContext context, IMapper mapper) : base(context, mapper) { }
public ManufacturerService(RentaCarContext context, IMapper mapper) : base(context, mapper) { }
public RatingService(RentaCarContext context, IMapper mapper) : base(context, mapper) { }
public CommentService(RentaCarContext context, IMapper mapper) : base(context, mapper) { }
public RecommendService(RentaCarContext context, IMapper mapper) { _context = context; _mapper = mapper; }