diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-02-20 08:55:29 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-02-20 08:55:29 +0200 |
| commit | a23cfede23d891712d2a2b840373075968f08994 (patch) | |
| tree | 3ca77277ffaf20f4a4332b2321e913553bf1e300 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication | |
| parent | 38009a30108ff250ac4884bf85a89014db27b3bd (diff) | |
| parent | b740f2922a16a3df2897a4acbfca94bb87685045 (diff) | |
| download | Tango-a23cfede23d891712d2a2b840373075968f08994.tar.gz Tango-a23cfede23d891712d2a2b840373075968f08994.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs | 11 |
1 files changed, 2 insertions, 9 deletions
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) { |
