public TruckLogicRepository(AutomobileContext context, IMapper mapper) { _context = context ?? throw new ArgumentNullException(nameof(AutomobileContext)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); }
public TruckController(ITruckLogicRepository logicRepository, IMapper mapper, AutomobileContext context) { _logicRepository = logicRepository ?? throw new ArgumentNullException(nameof(logicRepository)); _context = context ?? throw new ArgumentNullException(nameof(AutomobileContext)); }
public UserController(/*ITruckLogicRepository logicRepository*/ AutomobileContext context, IMapper mapper) { //_logicRepository = logicRepository ?? // throw new ArgumentNullException(nameof(logicRepository)); _context = context ?? throw new ArgumentNullException(nameof(AutomobileContext)); _mapper = mapper; }
protected override ValidationResult IsValid(object value, ValidationContext validationContext) { var db = new AutomobileContext(); var user = (UserAuthentication)validationContext.ObjectInstance; if (db.Database.ExecuteSqlRaw($"select Email from avto.Users where Email='{user.Email}'") != 0) { return(new ValidationResult($"The e-mail {user.Email} is already exist..", new[] { nameof(UserAuthentication) })); } //if (db.Users.Any(u=>u.Email==user.Email)) //{ // return new ValidationResult($"The e-mail {user.Email} is already exist..", // new[] {nameof(UserAuthentication)}); //} return(ValidationResult.Success); }
public ProjectRepository(AutomobileContext context) { _context = context; }
public CompanyRepository(AutomobileContext context) { _context = context; }
public CommentRepository(AutomobileContext context) { _context = context; }
public CarsController(AutomobileContext context) { _context = context; }
public UserRepository(AutomobileContext context) { _context = context; }
public BrandRepository(AutomobileContext context) { _context = context; }