Ejemplo n.º 1
0
        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>();
        }
Ejemplo n.º 2
0
            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();
            }
Ejemplo n.º 3
0
 public Handler(SkeletonDbContext db)
 {
     _db = db;
 }
Ejemplo n.º 4
0
 public MusicRepository(SkeletonDbContext context)
     : base(context)
 {
 }
Ejemplo n.º 5
0
 public FeaturesController(SkeletonDbContext context, IMapper mapper)
 {
     this.mapper  = mapper;
     this.context = context;
 }
Ejemplo n.º 6
0
 public ArtistRepository(SkeletonDbContext context)
     : base(context)
 {
 }
Ejemplo n.º 7
0
 public Handler(SkeletonDbContext db, IUserSession userSession)
 {
     _db          = db;
     _userSession = userSession;
 }
Ejemplo n.º 8
0
 public Handler(SkeletonDbContext db, IMailer mailer)
 {
     _db     = db;
     _mailer = mailer;
 }
Ejemplo n.º 9
0
 public static void Initialize()
 {
     Database.SetInitializer(new MigrateDatabaseToLatestVersion <SkeletonDbContext, Configuration>());
     SkeletonDbContext.Create().Database.Initialize(true);
 }