Ejemplo n.º 1
0
 public AddStudentTribeCommandHandler(TribeContext db)
 {
     _db = db;
     _mapperConfiguration = new MapperConfiguration(cfg =>
     {
         cfg.AddProfile <TribeDAOProfile>();
     });
 }
Ejemplo n.º 2
0
 public GetAllTribesByStudentQueryHandler(TribeContext db)
 {
     _db = db;
     _mapperConfiguration = new MapperConfiguration(cfg =>
     {
         cfg.AddProfile <TribeProfile>();
         cfg.CreateMap <TribeDAO, GetAllTribesByStudentResult>()
         .ForMember(m => m.Type, opt => opt.MapFrom(src => Enum.GetName(typeof(TribeType), src.Type)));
     });
 }
Ejemplo n.º 3
0
 public UpdateSubscriptionDetailsCommandHandler(TribeContext db, IMediator mediator)
 {
     _db                  = db;
     _mediator            = mediator;
     _mapperConfiguration = new MapperConfiguration(cfg =>
     {
         cfg.AddProfile <TribeDAOProfile>();
         cfg.CreateMap <GetTribeByTribeIdResult, Model.Tribe>()
         .ForMember(x => x.Members, opt => opt.MapFrom(src => src.Members));
     });
 }
Ejemplo n.º 4
0
 public DeleteStudentFromTribeCommandHandler(TribeContext db, IMediator mediator)
 {
     _db                  = db;
     _mediator            = mediator;
     _mapperConfiguration = new MapperConfiguration(cfg =>
     {
         cfg.AddProfile <TribeDAOProfile>();
         cfg.CreateMap <GetTribeByTribeIdResult, Model.Tribe>()
         .ForMember(m => m.Type, opt => opt.MapFrom(src => Enum.Parse(typeof(TribeType), src.Type)))
         .ForMember(m => m.Members, opt => opt.MapFrom(src => src.Members));
     });
 }
Ejemplo n.º 5
0
 public GetTribeByTribeIdQueryHandler(TribeContext db)
 {
     _db = db;
     _mapperConfiguration = new MapperConfiguration(cfg =>
     {
         cfg.AddProfile <TribeProfile>();
         cfg.CreateMap <TribeDAO, GetTribeByTribeIdResult>()
         .ForMember(m => m.Type, opt => opt.MapFrom(src => Enum.GetName(typeof(TribeType), src.Type)));
         cfg.CreateMap <MemberDAO, Member>();
         cfg.CreateMap <TribeSubscriptionDetailsDAO, TribeSubscriptionDetails>();
         cfg.CreateMap <SubscriptionRateDAO, SubscriptionRate>();
     });
 }
Ejemplo n.º 6
0
 public GetMembersByTribeQueryHandler(TribeContext tribeDb, ProfileContext profileDb)
 {
     _tribeDb             = tribeDb;
     _profileDb           = profileDb;
     _mapperConfiguration = new MapperConfiguration(cfg =>
     {
         cfg.AddProfile <TribeProfile>();
         cfg.AddProfile <ProfileProfile>();
         cfg.CreateMap <ProfileDAO, MiniProfileResult>()
         .ForMember(m => m.Id, opt => opt.MapFrom(src => src.Id))
         .ForMember(m => m.LastUpdate, opt => opt.MapFrom(src => src.LastUpdate))
         .ForMember(m => m.JoinDate, opt => opt.MapFrom(src => src.AppDetails.JoinDate))
         .ForMember(m => m.LastLogin, opt => opt.MapFrom(src => src.AppDetails.LastLogin))
         .ForMember(m => m.PersonalDetails, opt => opt.MapFrom(src => src.PersonalDetails));
     });
 }
Ejemplo n.º 7
0
 public DeleteTribeCommandHandler(TribeContext db)
 {
     _db = db;
 }