From 945520000da0ae4a3fa3b40e9756d67379e25314 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 19 Feb 2019 18:10:35 +0200 Subject: Machine Studio v4.0.8.0 --- .../Authentication/DefaultAuthenticationProvider.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs index e07952f29..d6fb50a8c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs @@ -16,6 +16,7 @@ using Tango.MachineStudio.Common; using Tango.MachineStudio.Common.StudioApplication; using Tango.Core.Helpers; using Tango.MachineStudio.Common.Web; +using Tango.BL.Builders; namespace Tango.MachineStudio.UI.Authentication { @@ -87,15 +88,7 @@ namespace Tango.MachineStudio.UI.Authentication using (ObservablesContext db = ObservablesContext.CreateDefault()) { - db.Roles.Load(); - db.Permissions.Load(); - db.RolesPermissions.Load(); - - User user = db.Users - .Include(x => x.UsersRoles) - .Include(x => x.Contact) - .Include(x => x.Address) - .Include(x => x.Organization).SingleOrDefault(x => x.Email.ToLower() == email.ToLower()); + User user = new UserBuilder(db).Set(x => x.Email.ToLower() == email.ToLower()).WithRolesAndPermissions().WithOrganization().Build(); if (user == null) { -- cgit v1.3.1