Base solution for your next web application

Activities of "rev319303"

Theoretically, I have 10 tenants. I code some new features and want to push these new features to all tenants. Now, I believe, if I just update the site with the new features then all tenants will not be able to see the new features until they go into their permissions and check the box for the new feature permission.

It is looking like I will need to go into the database and create a script that will assign the new permission to all tenants. Is this correct or is there a better way of doing this. If a script is the answer then do you already have that script that you could share?

Your thoughts?

Question

How do you handle custom c# validations? Do you have a standard way you do this or do I just need to handle this myself?

if(inputDto.blah  ==  "OhNo")
{
    //Throw some custom error back to the user
   throw new Exception("blah cannot equal OhNo");
}

I figured it out. It is case sensitive and wants camel case on the call. I changed my ajax call to this:

var _customerService = abp.services.app.customer;
_customerService.createNewStripeCustomerWithSubscription({
                    CaseType: "Unlimited",
                    stripeToken: token.id,
                    StripeEmail: token.email
                }).done(function () {
                    abp.notify.success("Successfully created subscription. Thank-You for your purchase!");
                });

Also, this was not needed in the PreInitialize()

Configuration.Modules.AbpAspNetCore().CreateControllersForAppServices(typeof(DiversionCore.DiversionCoreApplicationModule).Assembly, moduleName: "app", useConventionalHttpVerbs: true);

What am I missing?

I am trying to setup the create controllers for app services and it is not working.

Here is what I placed in my PreInitialize method in my web.mvc project. (Core/jquery project)

Configuration.Modules.AbpAspNetCore().CreateControllersForAppServices(typeof(DiversionCore.DiversionCoreApplicationModule).Assembly, moduleName: "app", useConventionalHttpVerbs: true);

Here is the setup of my customerAppService:

namespace DiversionCore.Customer
{
    public class CustomerAppService : DiversionCoreAppServiceBase, ICustomerAppService
    {
        private readonly IRepository<Customer> _customerRepository;
        private readonly IRepository<CustomerSubscription> _customerSubscriptionRepository;
        private readonly IStripeAppService _stripeAppService;
        private readonly IUnitOfWorkManager _unitOfWorkManager;

        public CustomerAppService(IRepository<Customer> customerRepository, 
            IRepository<CustomerSubscription> customerSubscriptionRepository, 
            IStripeAppService stripeAppService,
            IUnitOfWorkManager unitOfWorkManager)
        {
            _customerRepository = customerRepository;
            _customerSubscriptionRepository = customerSubscriptionRepository;
            _stripeAppService = stripeAppService;
            //_unitOfWorkManager = unitOfWorkManager;
        }

        public async Task<CustomerDto> GetCustomer()
        {
            CustomerDto model = new CustomerDto();
            if (AbpSession.UserId.HasValue)
            {
                var qry = await _customerRepository.FirstOrDefaultAsync(x => x.UserId == AbpSession.UserId.Value);
                
                if(qry != null)
                {
                    model = Mapper.Map<Customer, CustomerDto>(qry);
                    model.CurrentSubscriptionId = qry.CustomerSubscriptionList.Where(x => x.IsActive == true).Select(x => x.SubscriptionId).FirstOrDefault();
                    return model;
                }
            }
            return null;
        }
    }
}

Here is what I am typing in the browser which returns undefined:

var _customerService = abp.services.app.Customer;

How do I setup SSL with your core/Jquery project?

On a brand new view within the app I am getting these errors in the browser -> developer tools -> console window. Where can I get this sparkLine file and is it needed?

GET http://localhost:62115/lib/jquery.sparkline/dist/jquery.sparkline.js 404 (Not Found)

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.

I figured it out.

I just added this:

public virtual string StripeToken { get; set; }

to this file: MyProjectName.Authorization.Users.User.cs

Thanks

Please forgive me but this is my first code-first project. I'm used to the .edmx file doing these types of things for me.

Your answer is exactly what I thought but I do not see the AbpUser.cs class anywhere. Do you mean extend it here "MyProjectName.Authorization.Users.User.cs"? Or, do yo mean create my own User.cs that inherits AbpUser like "public class User : AbpUser<User>" and extend it here?

I am using the .Net Core template. I understand all the projects in the template except for the "MyProjectName.Web.Host" and the "MyProjectName.Web.Core" projects. I don't see any documentation on these projects. Can you provide a description of each project and how they relate to the entire solution as a whole?

I am implementing Stripe JS into my project which upon validation will give me a token per user. I want to store that token in the AbpUsers table. The ABP dbContext file seems to be compiled. Do I just manually update the SQL table or do you have another standard way of doing this?

I guess a better way of asking this is how do I update the out of the box ABP database tables?

I am using the .Net Core template.

Showing 11 to 20 of 20 entries