Base solution for your next web application

Activities of "naeazach"

Thanks, that worked. I didn't know that, like I said, this is a Data First to Code First lack of knowledge. I'm used to altering my table in sql then just refreshing my model =)

Well, it was just that those fields were required.

When I added them and did the migration after setting up the project it automatically set my existing users values to a blank string for all those values so none of them were null for sure (I had checked this after I did the migration because I was curious as to what it was going to do). It seems that the login doesn't bind the user appropriately if there have been new fields added to it perhaps.

It is odd that I'm getting a DbEntityValidationError though I thought because there isn't any sort of insert happening here, it should just be validating the creds, is there something beyond that happening I'm not aware of?

It's compiled into the dll so i really cant see what its doing exactly. This works for me for now, but it may be something you want to consider because the user object is very plain and most apps will have quite a bit of built onto that either directly on the table or adding a profile table.

so i removed the [Required] attributes and it worked again.

This is how I had done it. In User.cs in .Core / Authorization / Users:

    [MaxLength(255)]
    [Required]
    public string Company { get; set; }

    [MaxLength(255)]
    [Required]
    public string Address { get; set; }

    [MaxLength(255)]
    [Required]
    public string City { get; set; }

    [MaxLength(10)]
    [Required]
    public string St { get; set; }

    [MaxLength(10)]
    [Required]
    [DataType(DataType.PostalCode)]
    public string Zip { get; set; }

    [Required]
    [MaxLength(25)]
    [DataType(DataType.PhoneNumber)]
    public string PhonePrimary { get; set; }

So since these are not set I guess somewhere on the login void in the boilerplate dll it causes login to not work. Is there away around this? It'd be preferred to me to have these required.

ok i dug in forums and found MyExceptionHandler and added to my project.

The reason its failing is because some of my required profile elements are showing as null on the model. Why would the login model care about 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 11 to 16 of 16 entries