Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "moustafa"

Actually i tried to move it to UserManager.cs but i counted a problem in userrepository injection

Thank you for your reply i have a further questions and i appreciate your help

in UserManager i overrided CreateAsync Method then added CheckDuplicateMobileAsync Method

public override async Task<IdentityResult> CreateAsync(User user)
        {
            var result = await CheckDuplicateMobileAsync(user.Id, user.Mobile);
            if (!result.Succeeded)
            {
                return result;
            }
            return await base.CreateAsync(user);
        }

        public virtual async Task<IdentityResult> CheckDuplicateMobileAsync(long? expectedUserId, string mobile)
        {
           var user = (await FindByMobileAsync(mobile));  ////////////////////// This line
            if (user != null && user.Id != expectedUserId)
            {
         return AbpIdentityResult.Failed(string.Format(L("Identity.DuplicateMobile"), mobile));  /////////////// This line
            }

            return IdentityResult.Success;
        }

in UserStore

public class UserStore : AbpUserStore<Role, User>
    {
        private readonly IRepository<User, long> _userRepository;
        public UserStore(
            IRepository<User, long> userRepository,
            IRepository<UserLogin, long> userLoginRepository,
            IRepository<UserRole, long> userRoleRepository,
            IRepository<Role> roleRepository,
            IRepository<UserPermissionSetting, long> userPermissionSettingRepository,
            IUnitOfWorkManager unitOfWorkManager
            )
            : base(
                userRepository,
                userLoginRepository,
                userRoleRepository,
                roleRepository,
                userPermissionSettingRepository,
                unitOfWorkManager
            )
        {
            _userRepository = userRepository;
        }

        // Umbrella

        public virtual async Task<User> FindByMobileAsync(string mobile)
        {
            return await _userRepository.FirstOrDefaultAsync(
                user => user.Mobile == mobile
                );
        }
    }

1- FindByMobileAsync is not exists in current context ???? 2- CS0103 The name 'L' does not exist in the current context ???

what is wrong with my code ?

I fount the solution

[StringLength(50)]
        public override string Name { get; set; }
        [StringLength(50)]
        public override string Surname { get; set; }

Thank you

i did excactly as you told me to do but unfortunately i got the same error

Actually i succeed to change max length property as previous reply but still got an error after registration

await _unitOfWorkManager.Current.SaveChangesAsync();

Error Message Validation failed for one or more entities. See 'EntityValidationErrors' property for more details. Error Details Name: The field Name must be a string with a maximum length of 32.

Thank you fro your help that would be the code

[code]

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.Entity<User>().Property(t => t.Name).HasMaxLength(50);
            modelBuilder.Entity<User>().Property(t => t.Surname).HasMaxLength(50).IsOptional();
        }

[/code:2jfgtrv2]

formate required by kendo ui [http://demos.telerik.com/kendo-ui/service/Northwind.svc/Customers?$callback=jQuery112302619818966497245_1462638475848&%24inlinecount=allpages&%24format=json])

for abp i can't display the format provided by ABP web api services but i use Odata to accomplish the task

i hope that help

<cite>Paddyfink: </cite> Hello, I'm using kendo ui with ABP.

If you have a SPA application, don't use kendo asp.mvc wrapper but kendo ui angular directives

Actually i tried to use kendo ui angular directives but i faced a problem related to json format as the json returned by ASPNETZERO not match the json format expected from Kendo ui , can you please help me with that issue

you absolutely right i didn't notice that before , actually this problem occurs when ui-grid shows more than 10 records per page , i tested it in Firefox, Chrome, Opera,Internet Explorer unfortunately all has the same problem i hope we find a solution to fix it soon

Hello i think it's a simple problem related to style sheet i hope you fix it or someone help you with that issue but consider that if you want to disable languages by default you go to YourProjectEntityFramework > Migrations>Seed>DefaultLanguagesCreator.cs

static DefaultLanguagesCreator()
        {
            InitialLanguages = new List<ApplicationLanguage>
            {
                new ApplicationLanguage(null, "en", "English", "famfamfam-flag-gb"),
                new ApplicationLanguage(null, "ar", "العربية", "famfamfam-flag-sa"),
                new ApplicationLanguage(null, "de", "German", "famfamfam-flag-de"),
                new ApplicationLanguage(null, "it", "Italiano", "famfamfam-flag-it"),
                new ApplicationLanguage(null, "pt-BR", "Portuguese", "famfamfam-flag-br"),
                new ApplicationLanguage(null, "tr", "Türkçe", "famfamfam-flag-tr"),
                new ApplicationLanguage(null, "zh-CN", "简体中文", "famfamfam-flag-cn")
            };
        }

and you will find all languages included by default , so you can just comment any lines doesn't need to i hope that help you in someway best wishes

Showing 51 to 60 of 75 entries