Base solution for your next web application

Activities of "naeazach"

So I installed package: Microsoft.AspNet.WebApi.Cors to the web project and followed instructions found here:

<a class="postlink" href="http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api">http://www.asp.net/web-api/overview/sec ... in-web-api</a>

However, I am still being blocked. I think because of automated api config through aspnetzero framework that the cors set up is being superceded by something else. Any idea how to get this working? Thanks. This is what my service method looks like:

    [EnableCors(origins: "http://site.com", headers: "*", methods: "*")]
    public async Task&lt;List&lt;Project.Sub.Marketing.Webinar&gt;> GetWebinars()
    {
        var webinars = await _webinarRepository.GetAllListAsync();
        return webinars.Where(a => a.InSession == false  && a.WebinarAccount == "x" && a.StartTime >= today).OrderBy(a => a.StartTime).ToList();
    }

So when logging into host the only visible user is myself.

I'd like to return a list of all users on the site. But UserManager object appears to be bound to AbpSession. Is there a way to query the User list directly?

I'd like that to show in my host account in case i wind up with password problems on a tenant account that i can do the reset for.

So, for some reason when the app sends mails for me there is no display name ( i dont recall if i set one or not).

Also, the box i'm sending from is an exchange email so it supports aliasing, i'd like to swap out the display name and display address when sending mail for certain system messaging. however when i try this:

        emailMsg.From.DisplayName = "Site Support Center";
        emailMsg.From.Address = "[email protected]";

Both of those are ready only properties. So, my mail box name is "help" so the display name on the emails that comes in just "help" instead of "My Site Help Center" or whatever.

So ... a.) Is it possible to set the default display name for the smtp account for the site. b.) how in one off instances do i manually set it?

Thanks! Also have you figured out an upgrade price? I have another project coming my way I'd like to use the starter kit again for. Zach

I made a simple mailer like so: public class AppMailerService : DownPaymentAppServiceBase, IAppMailerService { private readonly IEmailSender _emailSender; private readonly ISmtpEmailSenderConfiguration _smtpConfig;

    public AppMailerService(ISmtpEmailSenderConfiguration smtpConfig, IEmailSender emailSender)
    {
        _smtpConfig = smtpConfig;
        _emailSender = emailSender;
    }


    public async Task SendSimpleMessageAsync(MailerInputDto input)
    {
        var smtpClient = new SmtpEmailSender(_smtpConfig).BuildClient();
        
        var from = new MailAddress(_smtpConfig.UserName);
        var msg = new MailMessage(from, new MailAddress(input.ToAddresses))
        {
            Subject = input.Subject,
            Body = input.Message,
            IsBodyHtml = true,

        };
        if (input.CCAddress != null)
        {
            msg.CC.Add(new MailAddress(input.CCAddress));
        }
        if (input.BCCAddress != null)
        {
            msg.Bcc.Add(new MailAddress(input.BCCAddress));
        }
        await _emailSender.SendAsync(msg, true);
       // smtpClient.Send(msg);
    }

}

I've noticed the await SendAsync seems to take a long time... 15 seconds-ish... is there a wait to skip the await method here? I don't care about server response since everything is being logged to database.

Thanks!

So I've added a geo service that has some handy geo lookup utils in it. What I'm trying to do from the home controller on a form submit to do the following.

        MyApp.Programs.IGeoAppService ga = new Programs.GeoAppService(new IRepository&lt;Programs.Geo&gt;());
        ga.GetCityFromZip(new GetGeoInput { Zip = "85210" });

but obviously new IRepository<Programs.Geo>()) is not allowed. Can you tell me how to properly access the service from a MVC controller?

Also, it would be handy if there was a way that abp could allow some publicly exposed services before the angular stuff comes in. is there some sort of config to do that?

After adding a few profile fields on my tenant table now I cant login to the system. This is the error in the log:

It's only logging the normal system exception unfortunately so i really have no way to see where the validation is failing. a) Any thoughts on this? Any idea what else happens on the login that would cause an update or insert? My login logs are empty as well so I feel like that is where its failing. b) Is extending the tenant object a bad idea?

ERROR 2015-07-14 21:25:24,024 [11 ] .Mvc.Controllers.AbpHandleErrorAttribute - System.Data.Entity.Validation.DbEntityValidationException: Validation failed for one or more entities. See 'EntityValidationErrors' property for more details. at System.Data.Entity.Internal.InternalContext.SaveChangesAsync(CancellationToken cancellationToken) at System.Data.Entity.Internal.LazyInternalContext.SaveChangesAsync(CancellationToken cancellationToken) at System.Data.Entity.DbContext.SaveChangesAsync(CancellationToken cancellationToken) at Abp.EntityFramework.AbpDbContext.SaveChangesAsync(CancellationToken cancellationToken) at System.Data.Entity.DbContext.SaveChangesAsync() at Abp.EntityFramework.Uow.EfUnitOfWork.<SaveChangesInDbContextAsync>d__a.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at Abp.EntityFramework.Uow.EfUnitOfWork.<SaveChangesAsync>d__1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at Abp.Authorization.Users.AbpUserManager3.<LoginAsync>d__37.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at NAEA.DownPayment.Web.Controllers.AccountController.<GetLoginResultAsync>d__10.MoveNext() in d:\Dropbox_downpayment.org\NAEA.DownPayment.Web\Controllers\AccountController.cs:line 147 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at NAEA.DownPayment.Web.Controllers.AccountController.<Login>d__7.MoveNext() in d:\Dropbox\_downpayment.org\NAEA.DownPayment.Web\Controllers\AccountController.cs:line 100 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Abp.Threading.InternalAsyncHelper.<ReturnGenericTaskAfterAction>d__31.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at System.Threading.Tasks.TaskHelpersExtensions.ThrowIfFaulted(Task task) at System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<BeginInvokeAsynchronousActionMethod>b__36(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase1.End() at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase1.End() at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) System.Data.Entity.Validation.DbEntityValidationException: Validation failed for one or more entities. See 'EntityValidationErrors' property for more details. at System.Data.Entity.Internal.InternalContext.SaveChangesAsync(CancellationToken cancellationToken) at System.Data.Entity.Internal.LazyInternalContext.SaveChangesAsync(CancellationToken cancellationToken) at System.Data.Entity.DbContext.SaveChangesAsync(CancellationToken cancellationToken) at Abp.EntityFramework.AbpDbContext.SaveChangesAsync(CancellationToken cancellationToken) at System.Data.Entity.DbContext.SaveChangesAsync() at Abp.EntityFramework.Uow.EfUnitOfWork.<SaveChangesInDbContextAsync>d__a.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at Abp.EntityFramework.Uow.EfUnitOfWork.<SaveChangesAsync>d__1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at Abp.Authorization.Users.AbpUserManager3.<LoginAsync>d__37.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at NAEA.DownPayment.Web.Controllers.AccountController.<GetLoginResultAsync>d__10.MoveNext() in d:\Dropbox\_downpayment.org\NAEA.DownPayment.Web\Controllers\AccountController.cs:line 147 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at NAEA.DownPayment.Web.Controllers.AccountController.<Login>d__7.MoveNext() in d:\Dropbox_downpayment.org\NAEA.DownPayment.Web\Controllers\AccountController.cs:line 100 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Abp.Threading.InternalAsyncHelper.<ReturnGenericTaskAfterAction>d__31.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at System.Threading.Tasks.TaskHelpersExtensions.ThrowIfFaulted(Task task) at System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<BeginInvokeAsynchronousActionMethod>b__36(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase1.End() at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase1.End() at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)

Question

First of all, I'd like to thank you for an excellent starter project. I had been developing and using something similar the last few years but no where near this built out. You literally saved me a few months of frustration on my current project.

Please excuse my ignorance as I'm used to using DataFirst Entity Objects so extending/adding a table is obviously much simpler with an EDMX in the project. What I'd like to do is one of the following:

Extend the User object to add profile info (company, addr info, etc). Add a UserProfile table with a parent relationship to the user table.

Any suggestion on where to achieve this in the project?

Showing 1 to 7 of 7 entries