public override void MapFromEntity(Site entity) { base.MapFromEntity(entity); ExpertsAmount = entity.Experts.Count; BeveragesAmount = entity.Beverages.Count; RoutesAmount = entity.Routes.Count; ActiveExpertsAmount = entity.Experts.Where(r => r.IsActive).Count(); ActiveBeveragesAmount = entity.Beverages.Where(r => r.IsActive).Count(); ActiveRoutesAmount = entity.Routes.Where(r => r.IsActive).Count(); WorkingHours = DayOfWeekInterval.Parse(entity.WorkingHours); ImportRelativeFtpPath = entity.ImportRelativeFtpPath; ShuffleExperts = entity.ShuffleExperts; Steps = entity.Steps .Select(r => new StepDto() { Id = r.Id, Descriptor = r.Descriptor, IsActive = r.IsActive, Name = r.Name, SiteId = r.SiteId, Order = r.Order }) .ToList(); FtpLogin = entity.FtpLogin; FtpPassword = entity.FtpPassword; SendEmailNotificationsToCustomer = entity.SendEmailNotificationsToCustomer; InjectButtonToSrp = entity.InjectButtonToSrp; InjectButtonToVdp = entity.InjectButtonToVdp; InjectButtonToSidebar = entity.InjectButtonToSidebar; InjectWidgetToSaw = entity.InjectWidgetToSaw; }
public override void MapFromEntity(Expert entity) { base.MapFromEntity(entity); UrlToSeparatedPage = String.IsNullOrWhiteSpace(entity.Site.WidgetAsSeparatePageUrl) ? null : $"{entity.Site.WidgetAsSeparatePageUrl}#expertId={Id}"; WorkingHours = DayOfWeekInterval.Parse(entity.WorkingHours); }
public override void MapFromEntity(Expert entity) { base.MapFromEntity(entity); SiteId = entity.SiteId; PhotoUrl = entity.PhotoUrl; Name = entity.Name; Title = entity.Title; Description = entity.Description; Email = entity.Email; PhoneNumber = entity.PhoneNumber; FacebookUrl = entity.FacebookUrl; LinkedinUrl = entity.LinkedinUrl; WorkingHours = DayOfWeekInterval.Parse(entity.WorkingHours); Order = entity.Order; IsActive = entity.IsActive; IsPartOfTeamNewCars = entity.IsPartOfTeamNewCars; IsPartOfTeamUsedCars = entity.IsPartOfTeamUsedCars; IsPartOfTeamCPO = entity.IsPartOfTeamCPO; EmployeeId = entity.EmployeeId; DealerraterUrl = entity.DealerraterUrl; }
public async Task <IList <DayOfWeekInterval> > RetrieveWeekSchedule(int id) { return(DayOfWeekInterval.Purify((await RetrieveAsync(id)).Experts.Where(r => r.IsActive).SelectMany(r => DayOfWeekInterval.Parse(r.WorkingHours)).ToList())); }