public GenericRepository(SkeletonDbContext context) { if (context == null) { throw new ArgumentException("An instance of DbContext is required to use this repository.", "context"); } this.Context = context; this.DbSet = this.Context.Set <T>(); }
public Validator(SkeletonDbContext db) { RuleFor(x => x.Name).NotEmpty(); RuleFor(x => x.Email) .NotEmpty() .EmailAddress() .MustAsync(async(s, ct) => await db.Users.NoneAsync(x => x.Email == s, ct)) .WithMessage("Email is already in use. It should be unique"); RuleFor(x => x.Password).NotEmpty().Equal(x => x.PasswordConfirmation).WithMessage("The password and confirmation password do not match"); RuleFor(x => x.PasswordConfirmation).NotEmpty(); }
public Handler(SkeletonDbContext db) { _db = db; }
public MusicRepository(SkeletonDbContext context) : base(context) { }
public FeaturesController(SkeletonDbContext context, IMapper mapper) { this.mapper = mapper; this.context = context; }
public ArtistRepository(SkeletonDbContext context) : base(context) { }
public Handler(SkeletonDbContext db, IUserSession userSession) { _db = db; _userSession = userSession; }
public Handler(SkeletonDbContext db, IMailer mailer) { _db = db; _mailer = mailer; }
public static void Initialize() { Database.SetInitializer(new MigrateDatabaseToLatestVersion <SkeletonDbContext, Configuration>()); SkeletonDbContext.Create().Database.Initialize(true); }