Exemplo n.º 1
0
 public ClinicService(
     IApiMapper mapper,
     IUnitOfWork unitOfWork)
 {
     _mapper     = mapper;
     _unitOfWork = unitOfWork;
 }
Exemplo n.º 2
0
 public DocumentService(
     IApiMapper mapper,
     IUnitOfWork unitOfWork)
 {
     _mapper     = mapper;
     _unitOfWork = unitOfWork;
 }
Exemplo n.º 3
0
 public CourseController(
     IService <CourseComment, long> service,
     IApiMapper <CourseComment, CourseCommentResponseModel> responseModelMapper,
     IApiMapper <CourseCommentRequestModel, CourseComment> requestModelMapper)
     : base(service, responseModelMapper, requestModelMapper)
 {
 }
Exemplo n.º 4
0
 public ClinicianController(
     IClinicianService clinicianService,
     IApiMapper mapper)
 {
     _clinicianService = clinicianService;
     _mapper           = mapper;
 }
Exemplo n.º 5
0
 public static IEnumerable <TOut> Map <TIn, TOut>(this IApiMapper <TIn, TOut> mapper, IQueryable <TIn> inputQueryable)
     where TOut : class, new()
 {
     return
         (mapper is IQueryableMapper <TIn, TOut> queryableProyector?queryableProyector.Map(inputQueryable)
              : inputQueryable.AsEnumerable().Select(x => mapper.Map(x)));
 }
Exemplo n.º 6
0
 public TrackerManager(IApiConnector apiConnector, IApiMapper apiMapper, ITrackerParser trackerParser, ILogger <TrackerManager> logger)
 {
     this.trackerParser = trackerParser;
     this.logger        = logger;
     this.apiConnector  = apiConnector;
     this.apiMapper     = apiMapper;
 }
Exemplo n.º 7
0
        public static Maybe <TOut> MapAndMaybeTakeFirst <TIn, TOut>(this IApiMapper <TIn, TOut> mapper, IQueryable <TIn> query)
            where TOut : class, new()
        {
            var result = mapper.MapAndTakeFirstOrDefault(query);

            return(result == null?Maybe.None <TOut>() : Maybe.From(result));
        }
Exemplo n.º 8
0
 public static void Add <TIn, TOut>(this IApiMapper <TIn, TOut> mapper, IEnumerable <TIn> inputEnumerable, ICollection <TOut> outputCollection)
     where TOut : class, new()
 {
     foreach (var item in mapper.Map(inputEnumerable))
     {
         outputCollection.Add(item);
     }
 }
Exemplo n.º 9
0
 public static void FillPage <TIn, TOut>(this IApiMapper <TIn, TOut> mapper, PaginationParameters pagination, IQueryable <TIn> inputQueryable, int totalItems, BaseCollectionPage <TOut> output)
     where TOut : class, new()
 {
     output.items.AddRange(mapper.Map(inputQueryable));
     output.pageSize    = pagination.per_page;
     output.itemsCount  = totalItems;
     output.currentPage = pagination.page;
 }
Exemplo n.º 10
0
 private static void FillPage <TIn, TOut, TPageItem>(IApiMapper <TIn, TOut> mapper, PaginationParameters pagination, IEnumerable <TIn> inputItems, int totalItems, BaseCollectionPage <TPageItem> output)
     where TOut : class, TPageItem, new()
 {
     output.items.AddRange(mapper.Map(inputItems));
     output.pageSize    = pagination.per_page;
     output.itemsCount  = totalItems;
     output.currentPage = pagination.page;
 }
 protected BaseRestApiController(
     IService <TDomainModel, TIdentity> service,
     IApiMapper <TDomainModel, TResponseModel> responseModelMapper,
     IApiMapper <TRequestModel, TDomainModel> requestModelMapper)
 {
     Service             = service;
     ResponseModelMapper = responseModelMapper;
     RequestModelMapper  = requestModelMapper;
 }
Exemplo n.º 12
0
        public static IEnumerable <TOut> Map <TIn, TOut>(this IApiMapper <TIn, TOut> mapper, IEnumerable <TIn> inputEnumerable)
            where TOut : class, new()
        {
            var queryableProyector = mapper as IQueryableMapper <TIn, TOut>;

            return
                (queryableProyector != null?queryableProyector.Map(inputEnumerable.AsQueryable())
                     : inputEnumerable.Select(x => mapper.Map(x)));
        }
Exemplo n.º 13
0
        public static TCollection MapCollection <TIn, TOut, TCollection>(this IApiMapper <TIn, TOut> mapper, IEnumerable <TIn> input)
            where TOut : class, new()
            where TCollection : IModelCollection <TOut>, new()
        {
            var result = new TCollection();

            mapper.FillCollection(input, result);
            return(result);
        }
Exemplo n.º 14
0
 public CourseCommentController(
     ICourseCommentService courseCommentService,
     IApiMapper <CourseComment, CourseCommentResponseModel> responseModelMapper,
     IApiMapper <CourseCommentRequestModel, CourseComment> requestModelMapper)
 {
     _courseCommentService = courseCommentService;
     _responseModelMapper  = responseModelMapper;
     _requestModelMapper   = requestModelMapper;
 }
Exemplo n.º 15
0
 public static TPage MapPage <TIn, TOut, TPageItem, TPage>(this IApiMapper <TIn, TOut> mapper, PaginationParameters pagination, IQueryable <TIn> query)
     where TOut : class, TPageItem, new()
     where TPage : BaseCollectionPage <TPageItem>, new()
 {
     return(mapper.MapPage <TIn, TOut, TPageItem, TPage>(
                pagination,
                query.Skip(pagination.offset).Take(pagination.per_page),
                query.Count()));
 }
Exemplo n.º 16
0
        public static TPage MapPage <TIn, TOut, TPageItem, TPage>(this IApiMapper <TIn, TOut> mapper, PaginationParameters pagination, IQueryable <TIn> inputQueriable, int totalItems)
            where TOut : class, TPageItem, new()
            where TPage : BaseCollectionPage <TPageItem>, new()
        {
            var result = new TPage();

            FillPage(mapper, pagination, inputQueriable, totalItems, result);
            return(result);
        }
Exemplo n.º 17
0
        // TODO: Make this API more friendly for consumers. It should not
        // be necessary to send all type parameters:
        //
        //     var mapped = _DtoSubscriber_To_Subscriber
        //        .MapPage<DtoSubscriber, Subscriber, SubscriberCollectionPage>(pagination, result.Items, result.TotalItemsFilter);
        //
        public static TPage MapPage <TIn, TOut, TPage>(this IApiMapper <TIn, TOut> mapper, PaginationParameters pagination, IEnumerable <TIn> input, int totalItems)
            where TOut : class, new()
            where TPage : BaseCollectionPage <TOut>, new()
        {
            var result = new TPage();

            mapper.FillPage(pagination, input, totalItems, result);
            return(result);
        }
 public WatchLaterItemController(
     IWatchLaterService watchLaterItemService,
     IApiMapper <WatchLaterItem, WatchLaterItemResponseModel> responseModelMapper,
     IApiMapper <WatchLaterItemRequestModel, WatchLaterItem> requestModelMapper)
 {
     _watchLaterItemService = watchLaterItemService;
     _responseModelMapper   = responseModelMapper;
     _requestModelMapper    = requestModelMapper;
 }
Exemplo n.º 19
0
 public AccountService(
     ITokenService tokenService,
     IUnitOfWork unitOfWork,
     IApiMapper mapper)
 {
     _tokenService = tokenService;
     _unitOfWork   = unitOfWork;
     _mapper       = mapper;
 }
Exemplo n.º 20
0
 public TokenService(
     IApiMapper mapper,
     IUnitOfWork unitOfWork,
     AppSettings appSetings)
 {
     _mapper     = mapper;
     _appSetings = appSetings;
     _unitOfWork = unitOfWork;
 }
Exemplo n.º 21
0
 public BookingService(
     IApiMapper mapper,
     IFileService fileService,
     ITokenService tokenService,
     IUnitOfWork unitOfWork)
 {
     _mapper       = mapper;
     _fileService  = fileService;
     _tokenService = tokenService;
     _unitOfWork   = unitOfWork;
 }
Exemplo n.º 22
0
        public static TOut Map <TIn, TOut>(this IApiMapper <TIn, TOut> mapper, TIn input)
            where TOut : class, new()
        {
            if (input == null)
            {
                return(null);
            }

            var output = new TOut();

            mapper.Fill(input, output);
            return(output);
        }
Exemplo n.º 23
0
 public FacultyController(IService <Faculty, int> service,
                          IApiMapper <Faculty, FacultyResponseModel> responseModelMapper,
                          IApiMapper <FacultyRequestModel, Faculty> requestModelMapper)
     : base(service, responseModelMapper, requestModelMapper)
 {
 }
Exemplo n.º 24
0
 public LectureController(IService <Lecture, Guid> service,
                          IApiMapper <Lecture, LectureResponseModel> responseModelMapper,
                          IApiMapper <LectureRequestModel, Lecture> requestModelMapper)
     : base(service, responseModelMapper, requestModelMapper)
 {
 }
Exemplo n.º 25
0
 public ItemsManager(IApiConnector apiConnector, IApiMapper apiMapper, ILogger <ItemsManager> logger)
 {
     this.apiConnector = apiConnector;
     this.apiMapper    = apiMapper;
     this.logger       = logger;
 }
Exemplo n.º 26
0
 public TeacherController(IService <Teacher, long> service,
                          IApiMapper <Teacher, TeacherResponseModel> responseModelMapper,
                          IApiMapper <TeacherRequestModel, Teacher> requestModelMapper) : base(service, responseModelMapper, requestModelMapper)
 {
 }
Exemplo n.º 27
0
 public SpecialityController(IService <Speciality, int> service,
                             IApiMapper <Speciality, SpecialityResponseModel> responseModelMapper,
                             IApiMapper <SpecialityRequestModel, Speciality> requestModelMapper)
     : base(service, responseModelMapper, requestModelMapper)
 {
 }
Exemplo n.º 28
0
 public Commerce(IApiConnector apiConnector, IApiMapper apiMapper)
 {
     this.apiConnector = apiConnector;
     this.apiMapper    = apiMapper;
 }
Exemplo n.º 29
0
 public CourseLikeController(ICourseService courseService,
                             IApiMapper <Course, CourseLikeResponseModel> responseModelMapper)
 {
     _courseService       = courseService;
     _responseModelMapper = responseModelMapper;
 }
Exemplo n.º 30
0
 public UserController(IService <User, Guid> service, IApiMapper <User, UserResponseModel> responseModelMapper,
                       IApiMapper <UserRequestModel, User> requestModelMapper)
     : base(service, responseModelMapper, requestModelMapper)
 {
 }