Base solution for your next web application

Activities of "easyest"

Could You please give us an update on Your success? I need exactly the same thing - to create wcf service, but I would not like to loose abp functionality.

Yes. I see the index is recreated in the last migration. Topic closed.

Answer

Bump

And if I am using constants? Put code into constant and use javascript translation? Translate in .Select from IQueryable in application service? Create some kind of provider, as in feature provider?

In my test project, that was based on Abp 0.6.3 I used custom attributes for that (please check attached file).

Few notes on those:

  1. This was done before localization was moved to Core project, so localization source name was set using configuration, now You should be able to get it directly.
  2. There are Display and DisplayName attributes - Display attribute cannot be extended, so You will need to use DisplayName attribute.
  3. For localized validation attributes to work You will need to register them in You Global.asax:
DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(LocalizedRequiredAttribute), typeof(RequiredAttributeAdapter));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(LocalizedStringLengthAttribute), typeof(StringLengthAttributeAdapter));
  1. LocalizedDisplayName attribute can be used on enums also, original DisplayName attribute can not.

Hope that helps :) Attributes.zip

+1 for such feature.

Hasan, I don't think they can answer Your question, as there is no question about ASP.NET Zero actually. There are only two ways to access a resource - with or without authorization. If You want You resource to be accessible without authorization - remove AbpAuthorize tag from Your method. If You want authorization, You will need to send something from Your Android app for the system to authorize. The method Authenticate gives You a token, that You will need to send with Your requests later and it's up to Your Android application to make sure this token is send with later requests. Another way would be to send basic authenticate header with Your api requests, but I am not sure if ASP.NET Zero supports that. On the other hand, this way is a really bad way, so You should not use it.

You cannot authorize "nothing". So, there needs to be a user that You can authorize. If You don't want to send user details - no problem with that, just check and authorize the default user. So, You need to have this default user in Your system - just create a tenant "guest" and admin user for this tenant with any password. Then create new method for login without model:

[HttpPost]
        public async Task<AjaxResponse> Authenticate()
        {
            CheckModelState();

            var loginResult = await GetLoginResultAsync(
                "admin",
                "adminpassword",
                "guest"
                );

            var ticket = new AuthenticationTicket(loginResult.Identity, new AuthenticationProperties());

            var currentUtc = new SystemClock().UtcNow;
            ticket.Properties.IssuedUtc = currentUtc;
            ticket.Properties.ExpiresUtc = currentUtc.Add(TimeSpan.FromMinutes(30));

            return new AjaxResponse(OAuthBearerOptions.AccessTokenFormat.Protect(ticket));
        }

The only difference is that You use predefined values for GetLoginResultAsync instead of values from login model.

Please search this forum - I have already posted such attributes with some comments to them.

Please excuse me, I may have asked wrong question. The question would be - how to extend organization unit entity? I can extend it as I want, but will OrganizationUnitManager use it? I can extend Tenant, because AbpTenantManager takes class as parameter, but this is not the case with OrganizationUnit , Edition, Language, LanguageText, Notification. So my question is how to extend those?

Showing 1 to 10 of 25 entries