Пример #1
0
        private static void RegisterCommonMapper()
        {
            //Inject CommonMapper the Auto Mapping Engine.
            var commonMapperProfileResolutionSettings = new List <CommonMapperProfileResolutionSettings>
            {
                new CommonMapperProfileResolutionSettings
                {
                    AssemblyName = Assembly.GetAssembly(typeof(OrderProfile)).GetName().Name,
                    Namespace    = new List <string> {
                        typeof(OrderProfile).Namespace
                    }
                },
                new CommonMapperProfileResolutionSettings
                {
                    AssemblyName = "Common.Lib.Domain",
                    Namespace    = null
                },
                new CommonMapperProfileResolutionSettings
                {
                    AssemblyName = "ANDP.Lib.Domain",
                    Namespace    = null
                }
            };

            var mapper = new CommonMapper(commonMapperProfileResolutionSettings);

            Container.RegisterType <ICommonMapper>(new ContainerControlledLifetimeManager(), new InjectionFactory(_ => mapper));
        }
Пример #2
0
        public ActionResult CentralColumn()
        {
            ContentGlassModel    contentGlassModel = CommonMapper.MapItem <ContentGlassModel>(Sitecore.Context.Item);
            List <BaseViewModel> model             = CommonMapper.MapContent(contentGlassModel.CentralColumn);

            return(View(model));
        }
 public ContentTypeMapDefinition(
     CommonMapper commonMapper,
     PropertyEditorCollection propertyEditors,
     IDataTypeService dataTypeService,
     IFileService fileService,
     IContentTypeService contentTypeService,
     IMediaTypeService mediaTypeService,
     IMemberTypeService memberTypeService,
     ILoggerFactory loggerFactory,
     IShortStringHelper shortStringHelper,
     IOptions <GlobalSettings> globalSettings,
     IHostingEnvironment hostingEnvironment)
     : this(
         commonMapper,
         propertyEditors,
         dataTypeService,
         fileService,
         contentTypeService,
         mediaTypeService,
         memberTypeService,
         loggerFactory,
         shortStringHelper,
         globalSettings,
         hostingEnvironment,
         StaticServiceProvider.Instance.GetRequiredService <IOptionsMonitor <ContentSettings> >())
 {
 }
Пример #4
0
        public ActionResult RightColumn()
        {
            ContentGlassModel    contentGlassModel = CommonMapper.MapItem <ContentGlassModel>(Sitecore.Context.Item);
            List <BaseViewModel> model             = CommonMapper.MapContent(contentGlassModel.RightColumn);

            return(View("AsideColumn", model));
        }
Пример #5
0
 public MemberMapDefinition(CommonMapper commonMapper, CommonTreeNodeMapper commonTreeNodeMapper,
                            MemberTabsAndPropertiesMapper tabsAndPropertiesMapper)
 {
     _commonMapper            = commonMapper;
     _commonTreeNodeMapper    = commonTreeNodeMapper;
     _tabsAndPropertiesMapper = tabsAndPropertiesMapper;
 }
    public ContentTypeMapDefinition(
        CommonMapper commonMapper,
        PropertyEditorCollection propertyEditors,
        IDataTypeService dataTypeService,
        IFileService fileService,
        IContentTypeService contentTypeService,
        IMediaTypeService mediaTypeService,
        IMemberTypeService memberTypeService,
        ILoggerFactory loggerFactory,
        IShortStringHelper shortStringHelper,
        IOptions <GlobalSettings> globalSettings,
        IHostingEnvironment hostingEnvironment,
        IOptionsMonitor <ContentSettings> contentSettings)
    {
        _commonMapper       = commonMapper;
        _propertyEditors    = propertyEditors;
        _dataTypeService    = dataTypeService;
        _fileService        = fileService;
        _contentTypeService = contentTypeService;
        _mediaTypeService   = mediaTypeService;
        _memberTypeService  = memberTypeService;
        _loggerFactory      = loggerFactory;
        _logger             = _loggerFactory.CreateLogger <ContentTypeMapDefinition>();
        _shortStringHelper  = shortStringHelper;
        _globalSettings     = globalSettings.Value;
        _hostingEnvironment = hostingEnvironment;

        _contentSettings = contentSettings.CurrentValue;
        contentSettings.OnChange(x => _contentSettings = x);
    }
        /// <summary>
        /// Obtiene una lista de lista de todas las compañias registradas en la base de datos
        /// </summary>
        /// <param name="IncludeDisabled">Parametro donde se indica si se obtendran los registros deshabilitados</param>
        /// <param name="CompanyId">Parametro donde se indica el número de Id de la compañia a obtener</param>
        /// <returns>Objeto de tipo ResponseDTO con el listado de las compañias obtenidas</returns>
        private ResponseDTO <List <CatalogsDTO> > Get(bool IncludeDisabled, int?CompanyId = null, int?ClientId = null)
        {
            database = DatabaseFactory.CreateDataBase(databaseType, "[CLIENT].[USP_GET_CLIENTS]", IncludeDisabled, CompanyId, ClientId);
            ResponseDTO <List <CatalogsDTO> > response = CommonMapper.CatalogsMapper(database.DataReader);

            database.Connection.Close();

            return(response);
        }
        /// <summary>
        /// Obtiene una lista de lista de todas las compañias registradas en la base de datos
        /// </summary>
        /// <param name="IncludeDisabled">Parametro donde se indica si se obtendran los registros deshabilitados</param>
        /// <param name="CompanyId">Parametro donde se indica el número de Id de la compañia a obtener</param>
        /// <returns>Objeto de tipo ResponseDTO con el listado de las compañias obtenidas</returns>
        private ResponseDTO <List <CatalogsDTO> > Get(bool IncludeDisabled, int?RoleId = null)
        {
            database = DatabaseFactory.CreateDataBase(databaseType, "[USER].[USP_GET_ROLES]", IncludeDisabled, RoleId);
            ResponseDTO <List <CatalogsDTO> > response = CommonMapper.CatalogsMapper(database.DataReader);

            database.Connection.Close();

            return(response);
        }
Пример #9
0
        /// <summary>
        /// Obtiene una lista de lista de todas las compañias registradas en la base de datos
        /// </summary>
        /// <param name="IncludeDisabled">Parametro donde se indica si se obtendran los registros deshabilitados</param>
        /// <param name="CompanyId">Parametro donde se indica el número de Id de la compañia a obtener</param>
        /// <returns>Objeto de tipo ResponseDTO con el listado de las compañias obtenidas</returns>
        private ResponseDTO <List <CatalogsDTO> > Get(bool IncludeDisabled, int?CompanyId)
        {
            database = DatabaseFactory.CreateDataBase(databaseType, CatalogsProcedureName.Get(CatalogEnum.Catalogs.Company), IncludeDisabled, CompanyId);
            ResponseDTO <List <CatalogsDTO> > response = CommonMapper.CatalogsMapper(database.DataReader);

            database.Connection.Close();

            return(response);
        }
Пример #10
0
        /// <summary>
        ///  获取用户登录信息
        /// </summary>
        /// <returns></returns>
        public ConfigObject GetUserLogin(string nsrsbh)
        {
            TConfig userEntity = UserService.GetFirstEntity(x => x.NSRSBH == nsrsbh && x.IsRemember == true);

            if (userEntity != null)
            {
                return(CommonMapper.ToDataObject <ConfigObject>(userEntity));
            }
            return(null);
        }
Пример #11
0
        /// <summary>
        /// 保存用户信息
        /// </summary>
        public void SaveUserInfo(ConfigObject configObject)
        {
            var entity = UserService.GetFirstEntity(x => x.NSRSBH == configObject.NSRSBH);

            if (entity == null)
            {
                TConfig tconfig = CommonMapper.ToEntity <TConfig>(configObject);
                UserService.AddEntities(tconfig);
            }
        }
Пример #12
0
        public MediaMapDefinition(ICultureDictionary cultureDictionary, CommonMapper commonMapper, CommonTreeNodeMapper commonTreeNodeMapper, IMediaService mediaService, IMediaTypeService mediaTypeService,
                                  ILocalizedTextService localizedTextService, MediaUrlGeneratorCollection mediaUrlGenerators, IOptions <ContentSettings> contentSettings, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider)
        {
            _commonMapper         = commonMapper;
            _commonTreeNodeMapper = commonTreeNodeMapper;
            _mediaService         = mediaService;
            _mediaTypeService     = mediaTypeService;
            _mediaUrlGenerators   = mediaUrlGenerators;
            _contentSettings      = contentSettings.Value ?? throw new ArgumentNullException(nameof(contentSettings));

            _tabsAndPropertiesMapper = new TabsAndPropertiesMapper <IMedia>(cultureDictionary, localizedTextService, contentTypeBaseServiceProvider);
        }
        /// <summary>
        /// Implementación de la interfaz para actualizar la información de una compañia
        /// </summary>
        /// <param name="entity">Parametro de tipo CatalogsDTO donde se envia los cambios a realizar a la compañia</param>
        /// <returns>Objeto de tipo ResponseDTO con el número de registros afectados</returns>
        public ResponseDTO <int> Update(CatalogsDTO entity)
        {
            database = DatabaseFactory.CreateDataBase(databaseType, "", entity.Id,
                                                      entity.Name,
                                                      entity.Description,
                                                      entity.Enabled);
            ResponseDTO <int> response = CommonMapper.GetRecordsAffected(database.DataReader);

            database.Connection.Close();

            return(response);
        }
Пример #14
0
        public ActionResult LeftNavigationBar()
        {
            Item item = Sitecore.Context.Item;

            if (item.TemplateID == ID.Parse(Constants.TemplatesIDs.DropdownItem))
            {
                item = item.Parent;
            }

            ItemLinkGlassModel glassModel = CommonMapper.MapItem <ItemLinkGlassModel>(item);

            return(View(new ItemLinkViewModel(glassModel)));
        }
        public ResponseDTO <int> Update(UserRequestDTO entity)
        {
            database = DatabaseFactory.CreateDataBase(databaseType, "[USER].[USP_UPDATE_USER]", entity.User.IdUser,
                                                      entity.User.Enabled,
                                                      entity.User.Password,
                                                      entity.Info.Name,
                                                      entity.Info.LastName,
                                                      entity.Info.Telephone,
                                                      entity.Info.HasTelephone);
            ResponseDTO <int> response = CommonMapper.GetRecordsAffected(database.DataReader);

            database.Connection.Close();

            return(response);
        }
        /// <summary>
        /// Implementación de la intefaz para agregar una nueva compañia en la base de datos
        /// </summary>
        /// <param name="entity">Entidad de tipo </param>
        /// <returns>Objeto de tipo ResponseDTO con el número de registros afectados</returns>
        public ResponseDTO <int> Add(CatalogsDTO entity)
        {
            ResponseDTO <int> response = new ResponseDTO <int>();

            response.Success = true;

            database = DatabaseFactory.CreateDataBase(databaseType, "", entity.Name,
                                                      entity.Description);

            response = CommonMapper.GetRecordsAffected(database.DataReader);

            database.Connection.Close();

            return(response);
        }
Пример #17
0
        public ContentMapDefinition(
            CommonMapper commonMapper,
            CommonTreeNodeMapper commonTreeNodeMapper,
            ICultureDictionary cultureDictionary,
            ILocalizedTextService localizedTextService,
            IContentService contentService,
            IContentTypeService contentTypeService,
            IFileService fileService,
            IUmbracoContextAccessor umbracoContextAccessor,
            IPublishedRouter publishedRouter,
            ILocalizationService localizationService,
            ILoggerFactory loggerFactory,
            IUserService userService,
            IVariationContextAccessor variationContextAccessor,
            IContentTypeBaseServiceProvider contentTypeBaseServiceProvider,
            UriUtility uriUtility,
            IPublishedUrlProvider publishedUrlProvider,
            IEntityService entityService,
            IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
            AppCaches appCaches)
        {
            _commonMapper               = commonMapper;
            _commonTreeNodeMapper       = commonTreeNodeMapper;
            _cultureDictionary          = cultureDictionary;
            _localizedTextService       = localizedTextService;
            _contentService             = contentService;
            _contentTypeService         = contentTypeService;
            _fileService                = fileService;
            _umbracoContextAccessor     = umbracoContextAccessor;
            _publishedRouter            = publishedRouter;
            _localizationService        = localizationService;
            _loggerFactory              = loggerFactory;
            _userService                = userService;
            _entityService              = entityService;
            _backOfficeSecurityAccessor = backOfficeSecurityAccessor;
            _variationContextAccessor   = variationContextAccessor;
            _uriUtility           = uriUtility;
            _publishedUrlProvider = publishedUrlProvider;
            _appCaches            = appCaches;

            _tabsAndPropertiesMapper = new TabsAndPropertiesMapper <IContent>(cultureDictionary, localizedTextService, contentTypeBaseServiceProvider);
            _stateMapper             = new ContentSavedStateMapper <ContentPropertyDisplay>();
            _basicStateMapper        = new ContentBasicSavedStateMapper <ContentPropertyBasic>();
            _contentVariantMapper    = new ContentVariantMapper(_localizationService, localizedTextService);
        }
Пример #18
0
        private static void RegisterCommonMapper()
        {
            //Inject CommonMapper the Auto Mapping Engine.
            var commonMapperProfileResolutionSettings = new List <CommonMapperProfileResolutionSettings>
            {
                new CommonMapperProfileResolutionSettings
                {
                    AssemblyName = "ANDP.Provisioning.API.Rest",
                    Namespace    = null
                },
                new CommonMapperProfileResolutionSettings
                {
                    AssemblyName = "ANDP.Lib",
                    Namespace    = null
                },
                new CommonMapperProfileResolutionSettings
                {
                    AssemblyName = "ANDP.Lib.Domain",
                    Namespace    = null
                },
                new CommonMapperProfileResolutionSettings
                {
                    AssemblyName = "Common.Lib.Domain",
                    Namespace    = null
                },
                new CommonMapperProfileResolutionSettings
                {
                    AssemblyName = "Common.Lib.Mvc",
                    Namespace    = null
                },
                new CommonMapperProfileResolutionSettings  //this is needed for the domain models such as tenant.
                {
                    AssemblyName = Assembly.GetAssembly(typeof(Tenant)).GetName().Name,
                    Namespace    = new List <string> {
                        typeof(Tenant).Namespace
                    }
                }
            };

            var mapper = new CommonMapper(commonMapperProfileResolutionSettings);

            Container.RegisterType <ICommonMapper>(new ContainerControlledLifetimeManager(), new InjectionFactory(_ => mapper));
        }
Пример #19
0
        /// <summary>
        /// 更新新增用户信息
        /// </summary>
        public void UpdateOrSaveUserInfo(ConfigObject configObject)
        {
            var entity = UserService.GetFirstEntity(x => x.NSRSBH == configObject.NSRSBH);

            if (entity != null)
            {
                string pwd     = configObject.LoginPwd;
                string certPwd = configObject.CertPwd;
                entity.LoginPwd   = pwd;
                entity.CertPwd    = certPwd;
                entity.IsRemember = configObject.IsRemember;
                UserService.UpdateEntities(entity);
            }
            else
            {
                TConfig tconfig = CommonMapper.ToEntity <TConfig>(configObject);
                UserService.AddEntities(tconfig);
            }
        }
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            var adAuthenticationCookie = httpContext.Request.Cookies[".ADAuthCookie"];

            if (adAuthenticationCookie != null)
            {
                bool     status       = false;
                var      userRole     = new List <string>();
                string[] allowedRoles = AllowedRole.Split(new char[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries);


                if (!string.IsNullOrEmpty(HttpContext.Current.Session["Role"] as string))
                {
                    userRole.Add(HttpContext.Current.Session["Role"].ToString());
                }
                else
                {
                    var authCookie           = httpContext.Request.Cookies[".ADAuthCookie"];
                    var authenticationTicket = FormsAuthentication.Decrypt(authCookie.Value);
                    var username             = authenticationTicket.Name;

                    var    user    = Membership.GetUser(username);
                    string utility = WebConfigurationManager.AppSettings["ProductName"];

                    var _commonMapper         = new CommonMapper();
                    var _authorizationService = new Authorization(_commonMapper.GetCommonDataBAseContext());
                    userRole = _authorizationService.GetRoleForUtility(user.Email, utility);
                }
                foreach (var role in userRole)
                {
                    if (allowedRoles.Contains(role))
                    {
                        status = true;
                    }
                }

                return(status);
            }


            return(false);
        }
Пример #21
0
        public ActionResult Register(UserView userView)
        {
            var anyUser = Repository.Users.Any(p => string.Compare(p.Email, userView.Email) == 0);

            if (anyUser)
            {
                ModelState.AddModelError("Email", "Пользователь с таким email уже зарегистрирован");
            }

            if (ModelState.IsValid)
            {
                var ModelMapper = new CommonMapper();
                var user        = (User)ModelMapper.Map(userView, typeof(UserView), typeof(User));

                Repository.CreateUser(user);
                return(RedirectToAction("Index"));
            }

            return(View(userView));
        }
        public ResponseDTO <int> Add(UserRequestDTO entity)
        {
            ResponseDTO <int> response = new ResponseDTO <int>();

            response.Success = true;

            database = DatabaseFactory.CreateDataBase(databaseType, "[USER].[USP_ADD_USER]", entity.User.IdCompany,
                                                      entity.User.UserName,
                                                      entity.User.Password,
                                                      entity.Info.Name,
                                                      entity.Info.LastName,
                                                      entity.Info.Telephone,
                                                      entity.Info.HasTelephone);

            response = CommonMapper.MapperId(database.DataReader);


            database.Connection.Close();

            return(response);
        }
Пример #23
0
        /// <summary>
        /// Вызывается, когда первый экземпляр HttpApplication создается. Это позволяет создавать объекты доступные для всех экземпляров класса HttpApplication.
        /// </summary>
        protected void Application_Start()
        {
            _logger.Info("Application starting");

            #region AreasRegistration
            var adminArea        = new AdminAreaRegistration();
            var adminAreaContext = new AreaRegistrationContext(adminArea.AreaName, RouteTable.Routes);
            adminArea.RegisterArea(adminAreaContext);

            var defaultArea        = new DefaultAreaRegistration();
            var defaultAreaContext = new AreaRegistrationContext(defaultArea.AreaName, RouteTable.Routes);
            defaultArea.RegisterArea(defaultAreaContext);
            #endregion

            //если сразу регистрировать все области, то сначала зарегается Default и тогда до Admin будет не достучаться
            //поэтому используем код выше
            //AreaRegistration.RegisterAllAreas();

            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            Database.SetInitializer <PracticeContext>(new EFDbInitializer());
            CommonMapper.Configurate();
        }
Пример #24
0
        /// <summary>
        /// Create member controller to test
        /// </summary>
        /// <param name="memberService">Member service</param>
        /// <param name="memberTypeService">Member type service</param>
        /// <param name="memberGroupService">Member group service</param>
        /// <param name="membersUserManager">Members user manager</param>
        /// <param name="dataTypeService">Data type service</param>
        /// <param name="backOfficeSecurityAccessor">Back office security accessor</param>
        /// <param name="mockPasswordChanger">Password changer class</param>
        /// <returns>A member controller for the tests</returns>
        private MemberController CreateSut(
            IMemberService memberService,
            IMemberTypeService memberTypeService,
            IMemberGroupService memberGroupService,
            IUmbracoUserManager <MemberIdentityUser> membersUserManager,
            IDataTypeService dataTypeService,
            IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
            IPasswordChanger <MemberIdentityUser> passwordChanger,
            IOptions <GlobalSettings> globalSettings,
            IUser user)
        {
            var httpContextAccessor = new HttpContextAccessor();

            var mockShortStringHelper          = new MockShortStringHelper();
            var textService                    = new Mock <ILocalizedTextService>();
            var contentTypeBaseServiceProvider = new Mock <IContentTypeBaseServiceProvider>();

            contentTypeBaseServiceProvider.Setup(x => x.GetContentTypeOf(It.IsAny <IContentBase>())).Returns(new ContentType(mockShortStringHelper, 123));
            var contentAppFactories              = new Mock <List <IContentAppFactory> >();
            var mockContentAppFactoryCollection  = new Mock <ILogger <ContentAppFactoryCollection> >();
            var hybridBackOfficeSecurityAccessor = new BackOfficeSecurityAccessor(httpContextAccessor);
            var contentAppFactoryCollection      = new ContentAppFactoryCollection(
                () => contentAppFactories.Object,
                mockContentAppFactoryCollection.Object,
                hybridBackOfficeSecurityAccessor);
            var mockUserService = new Mock <IUserService>();
            var commonMapper    = new CommonMapper(
                mockUserService.Object,
                contentTypeBaseServiceProvider.Object,
                contentAppFactoryCollection,
                textService.Object);
            var mockCultureDictionary = new Mock <ICultureDictionary>();

            var mockPasswordConfig = new Mock <IOptions <MemberPasswordConfigurationSettings> >();

            mockPasswordConfig.Setup(x => x.Value).Returns(() => new MemberPasswordConfigurationSettings());
            IDataEditor dataEditor = Mock.Of <IDataEditor>(
                x => x.Type == EditorType.PropertyValue &&
                x.Alias == Constants.PropertyEditors.Aliases.Label);

            Mock.Get(dataEditor).Setup(x => x.GetValueEditor()).Returns(new TextOnlyValueEditor(new DataEditorAttribute(Constants.PropertyEditors.Aliases.TextBox, "Test Textbox", "textbox"), textService.Object, Mock.Of <IShortStringHelper>(), Mock.Of <IJsonSerializer>(), Mock.Of <IIOHelper>()));

            var propertyEditorCollection = new PropertyEditorCollection(new DataEditorCollection(() => new[] { dataEditor }));

            IMapDefinition memberMapDefinition = new MemberMapDefinition(
                commonMapper,
                new CommonTreeNodeMapper(Mock.Of <LinkGenerator>()),
                new MemberTabsAndPropertiesMapper(
                    mockCultureDictionary.Object,
                    backOfficeSecurityAccessor,
                    textService.Object,
                    memberTypeService,
                    memberService,
                    memberGroupService,
                    mockPasswordConfig.Object,
                    contentTypeBaseServiceProvider.Object,
                    propertyEditorCollection));

            var map = new MapDefinitionCollection(() => new List <IMapDefinition>()
            {
                new global::Umbraco.Cms.Core.Models.Mapping.MemberMapDefinition(),
                memberMapDefinition,
                new ContentTypeMapDefinition(
                    commonMapper,
                    propertyEditorCollection,
                    dataTypeService,
                    new Mock <IFileService>().Object,
                    new Mock <IContentTypeService>().Object,
                    new Mock <IMediaTypeService>().Object,
                    memberTypeService,
                    new Mock <ILoggerFactory>().Object,
                    mockShortStringHelper,
                    globalSettings,
                    new Mock <IHostingEnvironment>().Object)
            });
            var scopeProvider = Mock.Of <IScopeProvider>(x => x.CreateScope(
                                                             It.IsAny <IsolationLevel>(),
                                                             It.IsAny <RepositoryCacheMode>(),
                                                             It.IsAny <IEventDispatcher>(),
                                                             It.IsAny <IScopedNotificationPublisher>(),
                                                             It.IsAny <bool?>(),
                                                             It.IsAny <bool>(),
                                                             It.IsAny <bool>()) == Mock.Of <IScope>());

            _mapper = new UmbracoMapper(map, scopeProvider);

            return(new MemberController(
                       new DefaultCultureDictionary(
                           new Mock <ILocalizationService>().Object,
                           NoAppCache.Instance),
                       new LoggerFactory(),
                       mockShortStringHelper,
                       new DefaultEventMessagesFactory(
                           new Mock <IEventMessagesAccessor>().Object),
                       textService.Object,
                       propertyEditorCollection,
                       _mapper,
                       memberService,
                       memberTypeService,
                       (IMemberManager)membersUserManager,
                       dataTypeService,
                       backOfficeSecurityAccessor,
                       new ConfigurationEditorJsonSerializer(),
                       passwordChanger,
                       scopeProvider
                       ));
        }
Пример #25
0
        public ActionResult Header()
        {
            HeaderContentGlassModel glassModel = CommonMapper.MapItem <HeaderContentGlassModel>(Sitecore.Context.Item);

            return(View(new HeaderContentViewModel(glassModel)));
        }
Пример #26
0
        public async Task <List <State> > GetAllAsync()
        {
            var states = await this._stateRepository.GetAllAsync();

            return(CommonMapper.MaptoState(states));
        }
Пример #27
0
        public async Task <List <Area> > GetAreasForCityStateAsync(int stateId, int cityId)
        {
            var areas = await this._stateRepository.GetAreasForCityState(stateId, cityId);

            return(CommonMapper.MaptoArea(areas));
        }
Пример #28
0
        public async Task <List <City> > GetCitiesForStateAsync(int stateId)
        {
            var cities = await this._stateRepository.GetCitiesForState(stateId);

            return(CommonMapper.MaptoCity(cities));
        }
Пример #29
0
 protected KafkaException(string message, Confluent.Kafka.KafkaException innerException) : base(message,
                                                                                                innerException)
 {
     StatusCode = 500;
     Value      = CommonMapper.Map(innerException.Error);
 }
Пример #30
0
 public CommonService(ICommonRepository repos)
 {
     this.Repository = repos;
     CommonMapper.Map();
 }