Ejemplo n.º 1
0
        public async Task <bool> Activate([FromBody] RoleRequestVM requestVM)
        {
            ApplicationRole request = requestVM.Convert();

            var response = await this.RoleApplication.Activate(request);

            return(response);
        }
Ejemplo n.º 2
0
        public async Task <List <ClaimListResponseVM> > GetListByRole([FromQuery] RoleRequestVM requestVM)
        {
            ApplicationRole request = requestVM.Convert();

            List <ApplicationClaim> response = await this.ClaimApplication.GetListByRole(request);

            List <ClaimListResponseVM> responseVM = response.ConvertList(base.UseDefaultLanguage);

            return(responseVM);
        }
Ejemplo n.º 3
0
        public async Task <RoleResponseVM> Get([FromQuery] RoleRequestVM requestVM)
        {
            ApplicationRole request = requestVM.Convert();

            ApplicationRole response = await this.RoleApplication.Get(request);

            RoleResponseVM responseVM = response.Convert(base.UseDefaultLanguage);

            return(responseVM);
        }
        //private static string GenerateResetLink(this ApplicationUser user)
        //{
        //    return "?userId=" + user.UserId + "&code=" ;
        //}

        //private static string GetResetMessage(string callbackUrl)
        //{
        //    return $"Please reset your password by clicking here: <a href='{callbackUrl}'>link</a>";
        //}
        #endregion

        #region ApplicationRole
        /// <summary>
        /// Convert converts object of RequestMakeVM type to State type.
        /// </summary>
        /// <param name="vm"></param>
        /// <returns></returns>
        public static ApplicationRole Convert(this RoleRequestVM vm)
        {
            var model = new ApplicationRole
            {
                RoleId      = vm.RoleId,
                RoleName    = vm.RoleName,
                Active      = vm.Active,
                CreatedById = vm.CurrentUserId
            };

            return(model);
        }