public ClinicService( IApiMapper mapper, IUnitOfWork unitOfWork) { _mapper = mapper; _unitOfWork = unitOfWork; }
public DocumentService( IApiMapper mapper, IUnitOfWork unitOfWork) { _mapper = mapper; _unitOfWork = unitOfWork; }
public CourseController( IService <CourseComment, long> service, IApiMapper <CourseComment, CourseCommentResponseModel> responseModelMapper, IApiMapper <CourseCommentRequestModel, CourseComment> requestModelMapper) : base(service, responseModelMapper, requestModelMapper) { }
public ClinicianController( IClinicianService clinicianService, IApiMapper mapper) { _clinicianService = clinicianService; _mapper = mapper; }
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))); }
public TrackerManager(IApiConnector apiConnector, IApiMapper apiMapper, ITrackerParser trackerParser, ILogger <TrackerManager> logger) { this.trackerParser = trackerParser; this.logger = logger; this.apiConnector = apiConnector; this.apiMapper = apiMapper; }
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)); }
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); } }
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; }
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; }
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))); }
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); }
public CourseCommentController( ICourseCommentService courseCommentService, IApiMapper <CourseComment, CourseCommentResponseModel> responseModelMapper, IApiMapper <CourseCommentRequestModel, CourseComment> requestModelMapper) { _courseCommentService = courseCommentService; _responseModelMapper = responseModelMapper; _requestModelMapper = requestModelMapper; }
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())); }
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); }
// 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; }
public AccountService( ITokenService tokenService, IUnitOfWork unitOfWork, IApiMapper mapper) { _tokenService = tokenService; _unitOfWork = unitOfWork; _mapper = mapper; }
public TokenService( IApiMapper mapper, IUnitOfWork unitOfWork, AppSettings appSetings) { _mapper = mapper; _appSetings = appSetings; _unitOfWork = unitOfWork; }
public BookingService( IApiMapper mapper, IFileService fileService, ITokenService tokenService, IUnitOfWork unitOfWork) { _mapper = mapper; _fileService = fileService; _tokenService = tokenService; _unitOfWork = unitOfWork; }
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); }
public FacultyController(IService <Faculty, int> service, IApiMapper <Faculty, FacultyResponseModel> responseModelMapper, IApiMapper <FacultyRequestModel, Faculty> requestModelMapper) : base(service, responseModelMapper, requestModelMapper) { }
public LectureController(IService <Lecture, Guid> service, IApiMapper <Lecture, LectureResponseModel> responseModelMapper, IApiMapper <LectureRequestModel, Lecture> requestModelMapper) : base(service, responseModelMapper, requestModelMapper) { }
public ItemsManager(IApiConnector apiConnector, IApiMapper apiMapper, ILogger <ItemsManager> logger) { this.apiConnector = apiConnector; this.apiMapper = apiMapper; this.logger = logger; }
public TeacherController(IService <Teacher, long> service, IApiMapper <Teacher, TeacherResponseModel> responseModelMapper, IApiMapper <TeacherRequestModel, Teacher> requestModelMapper) : base(service, responseModelMapper, requestModelMapper) { }
public SpecialityController(IService <Speciality, int> service, IApiMapper <Speciality, SpecialityResponseModel> responseModelMapper, IApiMapper <SpecialityRequestModel, Speciality> requestModelMapper) : base(service, responseModelMapper, requestModelMapper) { }
public Commerce(IApiConnector apiConnector, IApiMapper apiMapper) { this.apiConnector = apiConnector; this.apiMapper = apiMapper; }
public CourseLikeController(ICourseService courseService, IApiMapper <Course, CourseLikeResponseModel> responseModelMapper) { _courseService = courseService; _responseModelMapper = responseModelMapper; }
public UserController(IService <User, Guid> service, IApiMapper <User, UserResponseModel> responseModelMapper, IApiMapper <UserRequestModel, User> requestModelMapper) : base(service, responseModelMapper, requestModelMapper) { }