├── PolyGlotPersitence.Modeling ├── UMLClassDiagram1.classdiagram ├── UMLClassDiagram1.classdiagram.layout ├── UMLClassDiagram2.classdiagram.layout ├── plolyglopersistence.layerdiagram.suppressions └── UMLClassDiagram2.classdiagram ├── .nuget ├── NuGet.exe └── NuGet.Config ├── ASP.NET.MVC5.Client ├── Views │ ├── _ViewStart.cshtml │ ├── Home │ │ ├── About.cshtml │ │ ├── Contact.cshtml │ │ └── Index.cshtml │ ├── Account │ │ ├── ExternalLoginFailure.cshtml │ │ ├── ForgotPasswordConfirmation.cshtml │ │ ├── ConfirmEmail.cshtml │ │ ├── ResetPasswordConfirmation.cshtml │ │ ├── SendCode.cshtml │ │ ├── ForgotPassword.cshtml │ │ ├── _ExternalLoginsListPartial.cshtml │ │ ├── _SetPasswordPartial.cshtml │ │ ├── _RemoveAccountPartial.cshtml │ │ ├── VerifyCode.cshtml │ │ ├── _ChangePasswordPartial.cshtml │ │ ├── ExternalLoginConfirmation.cshtml │ │ ├── Register.cshtml │ │ └── ResetPassword.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── Lockout.cshtml │ │ ├── _LoginPartial.cshtml │ │ └── _Layout.cshtml │ ├── Department │ │ ├── Index.cshtml │ │ └── Create.cshtml │ ├── Facility │ │ ├── Index.cshtml │ │ └── Create.cshtml │ ├── Manage │ │ ├── AddPhoneNumber.cshtml │ │ ├── VerifyPhoneNumber.cshtml │ │ ├── SetPassword.cshtml │ │ ├── ChangePassword.cshtml │ │ └── ManageLogins.cshtml │ ├── Equipment │ │ ├── Index.cshtml │ │ └── Create.cshtml │ └── Web.config ├── favicon.ico ├── Global.asax ├── Scripts │ └── _references.js ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff ├── Models │ ├── AspnetIdentity │ │ ├── EmailModelTokenManegementServiceProvider.cs │ │ ├── PhoneNumberModelTokenManagementServiceProvider.cs │ │ ├── SmsManagementServices.cs │ │ ├── EmailManagementServices.cs │ │ ├── ApplicationUserValidator.cs │ │ ├── ApplicationSignInManager.cs │ │ ├── IApplicationUserStore.cs │ │ └── ApplicationUser.cs │ ├── DepartmentViewModels.cs │ ├── FacilityViewModels.cs │ └── EquipmentViewModels.cs ├── Helpers │ ├── HtmlHelperStaticContent.cs │ ├── HtmlHelperJson.cs │ └── HtmlHelperStaticContentAzure.cs ├── App_Start │ ├── FilterConfig.cs │ ├── RouteConfig.cs │ ├── BundleConfig.cs │ └── BootStrapper.cs ├── Startup.cs ├── Content │ └── Site.css ├── Global.asax.cs ├── Controllers │ └── HomeController.cs ├── Extensions │ ├── IoCControllerFactory.cs │ └── UnityWebResolver.cs ├── Web.Debug.config ├── Web.Release.config └── Properties │ └── AssemblyInfo.cs ├── README.md ├── Application.BoundedContext.Tests ├── TestFiles │ └── TestImage.jpg ├── UnitTest1.cs ├── Managers │ ├── OrganizationManagementServiceTests.cs │ └── EquipmentAggregateManagementServiceTests.cs ├── Properties │ └── AssemblyInfo.cs └── Initializer │ └── AssemblyTestsInitializerAzure.cs ├── Domain.BoundedContext ├── ERPModule │ ├── Enums │ │ ├── Gender.cs │ │ └── Civility.cs │ ├── Department │ │ ├── IDepartmentAggregateRepository.cs │ │ ├── DepartmentAggregate.cs │ │ ├── IDepartmentRepository.cs │ │ └── Department.cs │ ├── Address │ │ ├── IAddressRepository.cs │ │ └── Address.cs │ ├── Customer │ │ ├── ICustomerRepository.cs │ │ └── Customer.cs │ ├── Employee │ │ ├── IEmployeeRepository.cs │ │ └── Employee.cs │ ├── Organization │ │ ├── IOrganizationRepository.cs │ │ └── Organization.cs │ └── Position │ │ ├── IPositionRepository.cs │ │ └── Position.cs ├── MembershipModule │ ├── Role │ │ ├── IRoleRepository.cs │ │ └── Role.cs │ ├── User │ │ └── IUserRepository.cs │ ├── Logins │ │ ├── ILoginRepository.cs │ │ └── Login.cs │ ├── Claim │ │ ├── IClaimRepository.cs │ │ └── Claim.cs │ └── Profile │ │ ├── IProfileRepository.cs │ │ └── Profile.cs ├── BlobAggregates │ ├── IBlobAggregateRepository.cs │ └── BlobAggregate.cs ├── StoreModule │ └── Equipment │ │ ├── IEquipmentAggregateRepository.cs │ │ └── EquipmentAggregate.cs └── Properties │ └── AssemblyInfo.cs ├── ASP.NET.MVC5.Client.Tests ├── CodedUITests │ ├── Drivers │ │ ├── chromedriver_win32 │ │ │ └── chromedriver.exe │ │ ├── IEDriverServer_x64_2.44.0 │ │ │ └── IEDriverServer.exe │ │ └── IEDriverServer_Win32_2.44.0 │ │ │ └── IEDriverServer.exe │ ├── FacilityControllerTests.cs │ └── BrowserSelect │ │ └── BrowserSelect.cs ├── App.config ├── Controllers │ ├── EquipmentControllerTests.cs │ └── HomeControllerTest.cs ├── Properties │ └── AssemblyInfo.cs └── packages.config ├── Infrastructure.CrossCutting.IoC ├── packages.config ├── App.config ├── Properties │ └── AssemblyInfo.cs └── IoCFactory.cs ├── Infrastructure.Data.Core ├── packages.config ├── App.config ├── DataTableExtensions.cs ├── InMemorySet │ ├── InMemoryDbAsyncEnumerator.cs │ ├── InMemoryDbAsyncEnumerable.cs │ └── InMemoryDbAsyncQueryProvider.cs ├── Properties │ └── AssemblyInfo.cs ├── ISql.cs └── IQueryableUnitOfWork.cs ├── Infrastructure.CrossCutting.Test ├── UnitTest1.cs └── Properties │ └── AssemblyInfo.cs ├── Domain.Core.Tests ├── Classes │ └── TestEntity.cs ├── IdentityGeneratorTests.cs └── Properties │ └── AssemblyInfo.cs ├── Infrastructure.Data.BoundedContext.Test ├── UnitTest1.cs ├── Initializer │ └── AssemblyTestsInitializer.cs ├── Repositories │ ├── DepartmentAggregateRepositoryTests.cs │ ├── OrganizationRepositoryTests.cs │ └── EquipmentAggregateRepositotyTests.cs └── Properties │ └── AssemblyInfo.cs ├── PolyGlotPersistence.Azure.userprefs ├── Infrastructure.Data.BoundedContext ├── UnitOfWork │ ├── Azure │ │ └── IAzureBlobUnitOfWork.cs │ ├── Mongo │ │ └── IMongoUnitOfWork.cs │ ├── Lucene │ │ └── ILuceneBCUnitOfWork.cs │ ├── MainBCUnitOfWorkInitializer.cs │ └── IMainBCUnitOfWork.cs ├── packages.config ├── Repositories │ ├── ERPModule │ │ ├── AddressRepository.cs │ │ ├── CustomerRepository.cs │ │ ├── EmployeeRepository.cs │ │ ├── PositionRepository.cs │ │ ├── DepartmentRepository.cs │ │ ├── OrganizationRepository.cs │ │ └── DepartmentAggregateRepository.cs │ ├── MembershipModule │ │ ├── RoleRepository.cs │ │ ├── ProfileRepository.cs │ │ └── UserRepository.cs │ └── BlobAggregates │ │ └── BlobAggregateRepository.cs └── Properties │ └── AssemblyInfo.cs ├── Domain.Core ├── packages.config ├── IdentityGenerator.cs ├── Properties │ └── AssemblyInfo.cs └── IUnitOfWork.cs ├── ASP.NET.MVC5.Client.Cloud.Azure ├── ServiceConfiguration.Cloud.cscfg ├── ServiceConfiguration.Local.cscfg ├── ServiceDefinition.csdef └── ASP.NET.MVC5.Client.CloudContent │ ├── diagnostics.wadcfg │ └── diagnostics.wadcfgx ├── Application.BoundedContext ├── Blob │ ├── IBlobManagementServices.cs │ └── BlobManagementServices.cs ├── ERPModule │ ├── IOrganizationManagementService.cs │ ├── IDepartmentAggregateManagementService.cs │ ├── OrganizationManagementService.cs │ └── DepartmentAggregateManagementService.cs ├── StoreModule │ ├── IEquipmentAggregateManagementService.cs │ └── EquipmentAggregateManagementService.cs └── Properties │ └── AssemblyInfo.cs ├── Application.Core ├── Properties │ └── AssemblyInfo.cs └── Application.Core.csproj ├── Infrastructure.CrossCutting.SeedWork ├── Properties │ └── AssemblyInfo.cs ├── Logging │ └── ILogger.cs └── IoC │ └── IContainer.cs ├── Infrastructure.CrossCutting.NetFramework └── Properties │ └── AssemblyInfo.cs └── Infrastructure.Data.BoundedContext.Tests ├── Properties └── AssemblyInfo.cs └── Infrastructure.Data.BoundedContext.Tests.csproj /PolyGlotPersitence.Modeling/UMLClassDiagram1.classdiagram: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /PolyGlotPersitence.Modeling/UMLClassDiagram1.classdiagram.layout: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.nuget/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakhdar/PolyGlotPersistence/HEAD/.nuget/NuGet.exe -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakhdar/PolyGlotPersistence/HEAD/ASP.NET.MVC5.Client/favicon.ico -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="ASP.NET.MVC5.Client.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Scripts/_references.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakhdar/PolyGlotPersistence/HEAD/ASP.NET.MVC5.Client/Scripts/_references.js -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | find some descriptions about this project here http: 2 | //www.codeproject.com/Articles/889978/Polyglot-Persistence-Using-DDD-and-Repository-Unit. 3 | -------------------------------------------------------------------------------- /Application.BoundedContext.Tests/TestFiles/TestImage.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakhdar/PolyGlotPersistence/HEAD/Application.BoundedContext.Tests/TestFiles/TestImage.jpg -------------------------------------------------------------------------------- /Domain.BoundedContext/ERPModule/Enums/Gender.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.ERPModule 2 | { 3 | public enum Gender 4 | { 5 | Male, Female 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakhdar/PolyGlotPersistence/HEAD/ASP.NET.MVC5.Client/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakhdar/PolyGlotPersistence/HEAD/ASP.NET.MVC5.Client/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakhdar/PolyGlotPersistence/HEAD/ASP.NET.MVC5.Client/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Domain.BoundedContext/ERPModule/Enums/Civility.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.ERPModule 2 | { 3 | public enum Civility 4 | { 5 | Mr, Ms, Mrs, Dr, Pr 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "About"; 3 | } 4 |

@ViewBag.Title.

5 |

@ViewBag.Message

6 | 7 |

Use this area to provide additional information.

8 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client.Tests/CodedUITests/Drivers/chromedriver_win32/chromedriver.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakhdar/PolyGlotPersistence/HEAD/ASP.NET.MVC5.Client.Tests/CodedUITests/Drivers/chromedriver_win32/chromedriver.exe -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client.Tests/CodedUITests/Drivers/IEDriverServer_x64_2.44.0/IEDriverServer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakhdar/PolyGlotPersistence/HEAD/ASP.NET.MVC5.Client.Tests/CodedUITests/Drivers/IEDriverServer_x64_2.44.0/IEDriverServer.exe -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client.Tests/CodedUITests/Drivers/IEDriverServer_Win32_2.44.0/IEDriverServer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lakhdar/PolyGlotPersistence/HEAD/ASP.NET.MVC5.Client.Tests/CodedUITests/Drivers/IEDriverServer_Win32_2.44.0/IEDriverServer.exe -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Account/ExternalLoginFailure.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Login Failure"; 3 | } 4 | 5 |
6 |

@ViewBag.Title.

7 |

Unsuccessful login with service.

8 |
9 | -------------------------------------------------------------------------------- /Domain.BoundedContext/ERPModule/Department/IDepartmentAggregateRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.ERPModule 2 | { 3 | using Domain.Core; 4 | public interface IDepartmentAggregateRepository : IRepository 5 | { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Infrastructure.CrossCutting.IoC/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model System.Web.Mvc.HandleErrorInfo 2 | 3 | @{ 4 | ViewBag.Title = "Error"; 5 | } 6 | 7 |

Error.

8 |

An error occurred while processing your request.

9 | 10 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Models/AspnetIdentity/EmailModelTokenManegementServiceProvider.cs: -------------------------------------------------------------------------------- 1 | namespace ASP.NET.MVC5.Client.Models 2 | { 3 | using Microsoft.AspNet.Identity; 4 | public class EmailModelTokenManegementServiceProvider : EmailTokenProvider 5 | { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Models/AspnetIdentity/PhoneNumberModelTokenManagementServiceProvider.cs: -------------------------------------------------------------------------------- 1 | namespace ASP.NET.MVC5.Client.Models 2 | { 3 | using Microsoft.AspNet.Identity; 4 | public class PhoneNumberModelTokenManagementServiceProvider : PhoneNumberTokenProvider 5 | { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Shared/Lockout.cshtml: -------------------------------------------------------------------------------- 1 | @model System.Web.Mvc.HandleErrorInfo 2 | 3 | @{ 4 | ViewBag.Title = "Locked Out"; 5 | } 6 | 7 |
8 |

Locked out.

9 |

This account has been locked out, please try again later.

10 |
11 | -------------------------------------------------------------------------------- /PolyGlotPersitence.Modeling/UMLClassDiagram2.classdiagram.layout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Infrastructure.Data.Core/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Account/ForgotPasswordConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Forgot Password Confirmation"; 3 | } 4 | 5 |
6 |

@ViewBag.Title.

7 |
8 |
9 |

10 | Please check your email to reset your password. 11 |

12 |
13 | 14 | -------------------------------------------------------------------------------- /Application.BoundedContext.Tests/UnitTest1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | 4 | namespace Application.BoundedContext.Tests 5 | { 6 | [TestClass] 7 | public class UnitTest1 8 | { 9 | [TestMethod] 10 | public void TestMethod1() 11 | { 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Infrastructure.CrossCutting.Test/UnitTest1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | 4 | namespace Infrastructure.CrossCutting.Test 5 | { 6 | [TestClass] 7 | public class UnitTest1 8 | { 9 | [TestMethod] 10 | public void TestMethod1() 11 | { 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Helpers/HtmlHelperStaticContent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace System.Web.Mvc 4 | { 5 | public static class HtmlHelperStaticContent 6 | { 7 | public static string CdnContentUrl(this UrlHelper url, string contentPath) 8 | { 9 | return url.Content(contentPath); 10 | } 11 | 12 | } 13 | } -------------------------------------------------------------------------------- /Domain.Core.Tests/Classes/TestEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Domain.Core.Tests.Classes 8 | { 9 | public class TestEntity:EntityBase 10 | { 11 | 12 | public string TestProperty { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /PolyGlotPersitence.Modeling/plolyglopersistence.layerdiagram.suppressions: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Account/ConfirmEmail.cshtml: -------------------------------------------------------------------------------- 1 | { 2 | ViewBag.Title = "Confirm Email"; 3 | } 4 | 5 |

@ViewBag.Title.

6 |
7 |

8 | Thank you for confirming your email. Please @Html.ActionLink("Click here to Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" }) 9 |

10 |
11 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext.Test/UnitTest1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | 4 | namespace Infrastructure.Data.BoundedContext.Test 5 | { 6 | [TestClass] 7 | public class UnitTest1 8 | { 9 | [TestMethod] 10 | public void TestMethod1() 11 | { 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace ASP.NET.MVC5.Client 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Owin; 2 | using Owin; 3 | 4 | [assembly: OwinStartupAttribute(typeof(ASP.NET.MVC5.Client.Startup))] 5 | namespace ASP.NET.MVC5.Client 6 | { 7 | public partial class Startup 8 | { 9 | public void Configuration(IAppBuilder app) 10 | { 11 | ConfigureAuth(app); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client.Tests/App.config: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Domain.BoundedContext/ERPModule/Address/IAddressRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.ERPModule 2 | { 3 | using Domain.Core; 4 | 5 | /// 6 | /// Address repository contract 7 | /// 8 | /// 9 | public interface IAddressRepository:IRepository
10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Domain.BoundedContext/MembershipModule/Role/IRoleRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.MembershipModule 2 | { 3 | using Domain.Core; 4 | 5 | /// 6 | /// Role repository contract 7 | /// 8 | /// 9 | public interface IRoleRepository : IRepository 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Domain.BoundedContext/MembershipModule/User/IUserRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.MembershipModule 2 | { 3 | using Domain.Core; 4 | 5 | /// 6 | /// User repository contract 7 | /// 8 | /// 9 | public interface IUserRepository : IRepository 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Domain.BoundedContext/ERPModule/Customer/ICustomerRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.ERPModule 2 | { 3 | using Domain.Core; 4 | 5 | /// 6 | /// Customer repository contract 7 | /// 8 | /// 9 | public interface ICustomerRepository : IRepository 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Domain.BoundedContext/ERPModule/Employee/IEmployeeRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.ERPModule 2 | { 3 | using Domain.Core; 4 | 5 | /// 6 | /// Employee repository contract 7 | /// 8 | /// 9 | public interface IEmployeeRepository : IRepository 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Domain.BoundedContext/MembershipModule/Logins/ILoginRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.MembershipModule 2 | { 3 | using Domain.Core; 4 | 5 | /// 6 | /// Login repository contract 7 | /// 8 | /// 9 | public interface ILoginRepository : IRepository 10 | { 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /Domain.BoundedContext/MembershipModule/Claim/IClaimRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.MembershipModule 2 | { 3 | using Domain.Core; 4 | 5 | /// 6 | /// Login repository contract 7 | /// 8 | /// 9 | public interface IClaimRepository : IRepository 10 | { 11 | 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /Domain.BoundedContext/MembershipModule/Profile/IProfileRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.MembershipModule 2 | { 3 | using Domain.Core; 4 | 5 | /// 6 | /// User repository contract 7 | /// 8 | /// 9 | public interface IProfileRepository : IRepository 10 | { 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /Domain.BoundedContext/ERPModule/Organization/IOrganizationRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.ERPModule 2 | { 3 | using Domain.Core; 4 | 5 | /// 6 | /// Organization repository contract 7 | /// 8 | /// 9 | public interface IOrganizationRepository : IRepository 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext.Test/Initializer/AssemblyTestsInitializer.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Infrastructure.Data.BoundedContext 4 | { 5 | [TestClass] 6 | public class AssemblyTestsInitialize 7 | { 8 | [AssemblyInitialize] 9 | public static void RebuildUnitOfWork(TestContext context) 10 | { 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Models/AspnetIdentity/SmsManagementServices.cs: -------------------------------------------------------------------------------- 1 | namespace ASP.NET.MVC5.Client.Models 2 | { 3 | using Microsoft.AspNet.Identity; 4 | using System.Threading.Tasks; 5 | public class SmsManagementServices : IIdentityMessageService 6 | { 7 | public Task SendAsync(IdentityMessage message) 8 | { 9 | return Task.FromResult(0); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /PolyGlotPersistence.Azure.userprefs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Models/AspnetIdentity/EmailManagementServices.cs: -------------------------------------------------------------------------------- 1 | namespace ASP.NET.MVC5.Client.Models 2 | { 3 | using Microsoft.AspNet.Identity; 4 | using System.Threading.Tasks; 5 | public class EmailManagementServices : IIdentityMessageService 6 | { 7 | public Task SendAsync(IdentityMessage message) 8 | { 9 | return Task.FromResult(0); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Account/ResetPasswordConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Reset password confirmation"; 3 | } 4 | 5 |
6 |

@ViewBag.Title.

7 |
8 |
9 |

10 | Your password has been reset. Please @Html.ActionLink("click here to log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" }) 11 |

12 |
13 | -------------------------------------------------------------------------------- /Domain.BoundedContext/BlobAggregates/IBlobAggregateRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.BlobAggregates 2 | { 3 | using Domain.Core; 4 | 5 | /// 6 | /// BlobAggregate repository contract 7 | /// 8 | /// 9 | public interface IBlobAggregateRepository : IRepository 10 | { 11 | 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /Domain.BoundedContext/StoreModule/Equipment/IEquipmentAggregateRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.StoreModule 2 | { 3 | using Domain.Core; 4 | 5 | /// 6 | /// Customer repository contract 7 | /// 8 | /// 9 | public interface IEquipmentAggregateRepository : IRepository 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext/UnitOfWork/Azure/IAzureBlobUnitOfWork.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace Infrastructure.Data.BoundedContext.UnitOfWork 3 | { 4 | using Domain.BoundedContext.BlobAggregates; 5 | using Domain.Core; 6 | using Infrastructure.Data.Core; 7 | using System; 8 | using System.Data.Entity; 9 | 10 | public interface IAzureBlobUnitOfWork : IQueryableUnitOfWork, IUnitOfWork, IDisposable 11 | { 12 | IDbSet BlobAggregates { get; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Models/AspnetIdentity/ApplicationUserValidator.cs: -------------------------------------------------------------------------------- 1 | using Application.BoundedContext.MembershipModule; 2 | using Microsoft.AspNet.Identity; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Web; 7 | 8 | namespace ASP.NET.MVC5.Client.Models 9 | { 10 | public class ApplicationUserValidator : UserValidator 11 | { 12 | public ApplicationUserValidator(ApplicationUserManager manager) 13 | : base(manager) 14 | { 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Home/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Contact"; 3 | } 4 |

@ViewBag.Title.

5 |

@ViewBag.Message

6 | 7 |
8 | One Microsoft Way
9 | Redmond, WA 98052-6399
10 | P: 11 | 425.555.0100 12 |
13 | 14 |
15 | Support: Support@example.com
16 | Marketing: Marketing@example.com 17 |
-------------------------------------------------------------------------------- /Domain.Core/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext/UnitOfWork/Mongo/IMongoUnitOfWork.cs: -------------------------------------------------------------------------------- 1 | using Domain.BoundedContext.ERPModule; 2 | using Infrastructure.Data.Core; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Data.Entity; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Infrastructure.Data.BoundedContext.UnitOfWork.Mongo 11 | { 12 | public interface IMongoUnitOfWork : IQueryableUnitOfWork 13 | { 14 | IDbSet Departments { get; } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Domain.Core.Tests/IdentityGeneratorTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | 4 | namespace Domain.Core.Test 5 | { 6 | [TestClass] 7 | public class IdentityGeneratorTests 8 | { 9 | [TestMethod] 10 | public void SequentialGuidTest() 11 | { 12 | //Arrange,Act 13 | var id = IdentityGenerator.SequentialGuid(); 14 | 15 | //Assert 16 | Assert.IsNotNull(id); 17 | Assert.IsTrue(id!=Guid.Empty); 18 | 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext/UnitOfWork/Lucene/ILuceneBCUnitOfWork.cs: -------------------------------------------------------------------------------- 1 | namespace Infrastructure.Data.BoundedContext.UnitOfWork.Lucene 2 | { 3 | using System.Collections.Generic; 4 | using System.Data.Entity; 5 | 6 | using Domain.BoundedContext.StoreModule; 7 | 8 | using Infrastructure.Data.Core; 9 | using global::Lucene.Net.Linq; 10 | 11 | /// The LuceneBCUnitOfWork interface. 12 | public interface ILuceneBCUnitOfWork : IQueryableUnitOfWork 13 | { 14 | LuceneDataProvider DataProvider { get; } 15 | IDbSet Equipments { get; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Override the default bootstrap behavior where horizontal description lists 13 | will truncate terms that are too long to fit in the left column 14 | */ 15 | .dl-horizontal dt { 16 | white-space: normal; 17 | } 18 | 19 | /* Set width on the form input elements since they're 100% wide by default */ 20 | input, 21 | select, 22 | textarea { 23 | max-width: 280px; 24 | } 25 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client.Cloud.Azure/ServiceConfiguration.Cloud.cscfg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client.Cloud.Azure/ServiceConfiguration.Local.cscfg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Optimization; 7 | using System.Web.Routing; 8 | 9 | namespace ASP.NET.MVC5.Client 10 | { 11 | public class MvcApplication : System.Web.HttpApplication 12 | { 13 | protected void Application_Start() 14 | { 15 | AreaRegistration.RegisterAllAreas(); 16 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 17 | RouteConfig.RegisterRoutes(RouteTable.Routes); 18 | BundleConfig.RegisterBundles(BundleTable.Bundles); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace ASP.NET.MVC5.Client 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace ASP.NET.MVC5.Client.Controllers 8 | { 9 | public class HomeController : Controller 10 | { 11 | public ActionResult Index() 12 | { 13 | return View(); 14 | } 15 | 16 | public ActionResult About() 17 | { 18 | ViewBag.Message = "Your application description page."; 19 | 20 | return View(); 21 | } 22 | 23 | public ActionResult Contact() 24 | { 25 | ViewBag.Message = "Your contact page."; 26 | 27 | return View(); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Helpers/HtmlHelperJson.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace System.Web.Mvc 5 | { 6 | public static class HtmlHelperJson 7 | { 8 | private static readonly JsonSerializerSettings settings; 9 | 10 | static HtmlHelperJson() 11 | { 12 | settings = new JsonSerializerSettings(); 13 | settings.ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver(); 14 | } 15 | 16 | public static MvcHtmlString ToJson(this HtmlHelper html, object value) 17 | { 18 | return MvcHtmlString.Create(JsonConvert.SerializeObject(value, Formatting.None, settings)); 19 | } 20 | 21 | 22 | 23 | 24 | } 25 | } -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Models/AspnetIdentity/ApplicationSignInManager.cs: -------------------------------------------------------------------------------- 1 | namespace ASP.NET.MVC5.Client.Models 2 | { 3 | using Microsoft.AspNet.Identity.Owin; 4 | using Microsoft.Owin.Security; 5 | using System.Security.Claims; 6 | using System.Threading.Tasks; 7 | public class ApplicationSignInManager : SignInManager 8 | { 9 | public ApplicationSignInManager(ApplicationUserManager userManager, IAuthenticationManager authenticationManager) 10 | : base(userManager, authenticationManager) 11 | { 12 | } 13 | 14 | public override Task CreateUserIdentityAsync(ApplicationUser user) 15 | { 16 | return user.GenerateUserIdentityAsync((ApplicationUserManager)UserManager); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Domain.BoundedContext/ERPModule/Department/DepartmentAggregate.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.ERPModule 2 | { 3 | using Domain.Core; 4 | using System; 5 | 6 | public class DepartmentAggregate : EntityBase 7 | { 8 | 9 | public string Name { get; set; } 10 | 11 | /// 12 | /// Get or set associated Organization identifier 13 | /// 14 | public Guid FacilityId { get; set; } 15 | 16 | /// 17 | /// Get or set associated Organization Name 18 | /// 19 | public string FacilityName { get; set; } 20 | 21 | 22 | /// 23 | /// Get or set associated Organization Description 24 | /// 25 | public string Description { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Domain.BoundedContext/ERPModule/Position/IPositionRepository.cs: -------------------------------------------------------------------------------- 1 | //=================================================================================== 2 | // 3 | //=================================================================================== 4 | // 5 | // 6 | // 7 | //=================================================================================== 8 | // 9 | // 10 | // 11 | //=================================================================================== 12 | 13 | 14 | namespace Domain.BoundedContext.ERPModule 15 | { 16 | using Domain.Core; 17 | 18 | /// 19 | /// Position repository contract 20 | /// 21 | /// 22 | public interface IPositionRepository : IRepository 23 | { 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Domain.BoundedContext/ERPModule/Department/IDepartmentRepository.cs: -------------------------------------------------------------------------------- 1 | //=================================================================================== 2 | // 3 | //=================================================================================== 4 | // 5 | // 6 | // 7 | //=================================================================================== 8 | // 9 | // 10 | // 11 | //=================================================================================== 12 | 13 | 14 | namespace Domain.BoundedContext.ERPModule 15 | { 16 | using Domain.Core; 17 | 18 | /// 19 | /// Department repository contract 20 | /// 21 | /// 22 | public interface IDepartmentRepository : IRepository 23 | { 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext/UnitOfWork/MainBCUnitOfWorkInitializer.cs: -------------------------------------------------------------------------------- 1 | using Domain.BoundedContext.ERPModule; 2 | using Domain.BoundedContext.MembershipModule; 3 | using System.Data.Entity; 4 | 5 | namespace Infrastructure.Data.BoundedContext.UnitOfWork 6 | { 7 | public class MainBCUnitOfWorkInitializer : DropCreateDatabaseAlways 8 | { 9 | protected override void Seed(MainBCUnitOfWork unitOfWork) 10 | { 11 | InitialMemorySet initialMemorySet = new InitialMemorySet(); 12 | foreach (Customer entity in initialMemorySet.Customers) 13 | unitOfWork.Customers.Add(entity); 14 | foreach (User entity in initialMemorySet.Users) 15 | unitOfWork.Users.Add(entity); 16 | unitOfWork.Commit(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Domain.BoundedContext/BlobAggregates/BlobAggregate.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.BlobAggregates 2 | { 3 | using Domain.Core; 4 | using System.IO; 5 | public class BlobAggregate : EntityBase 6 | { 7 | /// 8 | /// Get or set blob directory name 9 | /// 10 | public string DirectoryName { get; set; } 11 | 12 | /// 13 | /// Get or set blob file name 14 | /// 15 | public string FileName { get; set; } 16 | 17 | /// 18 | /// Get or set blob Container name 19 | /// 20 | public string ContainerName { get; set; } 21 | 22 | /// 23 | /// Get or set the Content 24 | /// 25 | public Stream Content { get; set; } 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Models/AspnetIdentity/IApplicationUserStore.cs: -------------------------------------------------------------------------------- 1 | namespace ASP.NET.MVC5.Client.Models 2 | { 3 | using Application.BoundedContext.MembershipModule; 4 | using Microsoft.AspNet.Identity; 5 | using System; 6 | public interface IApplicationUserStore : IUserLoginStore, 7 | IUserClaimStore, 8 | IUserRoleStore, 9 | IUserPasswordStore, 10 | IUserSecurityStampStore, 11 | IQueryableUserStore, 12 | IUserEmailStore, 13 | IUserPhoneNumberStore, 14 | IUserTwoFactorStore, 15 | IUserLockoutStore, 16 | IUserStore, 17 | IDisposable 18 | { 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client.Cloud.Azure/ServiceDefinition.csdef: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Account/SendCode.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET.MVC5.Client.Models.SendCodeViewModel 2 | @{ 3 | ViewBag.Title = "Send"; 4 | } 5 | 6 |

@ViewBag.Title.

7 | 8 | @using (Html.BeginForm("SendCode", "Account", new { ReturnUrl = Model.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { 9 | @Html.AntiForgeryToken() 10 | @Html.Hidden("rememberMe", @Model.RememberMe) 11 |

Send verification code

12 |
13 |
14 |
15 | Select Two-Factor Authentication Provider: 16 | @Html.DropDownListFor(model => model.SelectedProvider, Model.Providers) 17 | 18 |
19 |
20 | } 21 | 22 | @section Scripts { 23 | @Scripts.Render("~/bundles/jqueryval") 24 | } 25 | -------------------------------------------------------------------------------- /Application.BoundedContext/Blob/IBlobManagementServices.cs: -------------------------------------------------------------------------------- 1 | namespace Application.BoundedConext.Blob 2 | { 3 | using Domain.BoundedContext.BlobAggregates; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | public interface IBlobManagementServices 7 | { 8 | 9 | /// 10 | /// Upload a file to blob storage as blob aggregate 11 | /// 12 | /// a file as blobAggregate 13 | /// 14 | Task UploadBlobAsync(BlobAggregate file); 15 | 16 | 17 | /// 18 | /// Upload a file to blob storage as blob aggregate 19 | /// 20 | /// a collection of files as blobAggregate to upload to storage 21 | /// 22 | Task UploadBlobAsync(IEnumerable files); 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Department/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET.MVC5.Client.Models.DepartmentListViewModel 2 | @{ 3 | ViewBag.Title = "Index"; 4 | } 5 | 6 |

All Departments

7 | @Html.ActionLink("Create", "Create", "Department", new { @class = "btn btn-primary btn-lg pull-right" }) 8 |

Total : @Model.Total

9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | @foreach (var f in @Model.Departments) 20 | { 21 | 22 | 23 | 24 | 25 | 26 | 27 | } 28 | 29 |
IdDepartment NameFacility NameDescription
@f.Id@f.Name@f.FacilityName@f.Description
30 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext/UnitOfWork/IMainBCUnitOfWork.cs: -------------------------------------------------------------------------------- 1 | namespace Infrastructure.Data.BoundedContext.UnitOfWork 2 | { 3 | using Domain.BoundedContext.ERPModule; 4 | using Domain.BoundedContext.MembershipModule; 5 | using Domain.Core; 6 | using Infrastructure.Data.Core; 7 | using System; 8 | using System.Data.Entity; 9 | 10 | public interface IMainBCUnitOfWork : IQueryableUnitOfWork, IUnitOfWork, IDisposable, ISql 11 | { 12 | IDbSet Customers { get; } 13 | 14 | IDbSet
Addresses { get; } 15 | 16 | IDbSet Departments { get; } 17 | 18 | IDbSet Organizations { get; } 19 | 20 | IDbSet Positions { get; } 21 | 22 | IDbSet Users { get; } 23 | 24 | IDbSet Roles { get; } 25 | 26 | IDbSet Logins { get; } 27 | 28 | IDbSet UserClaims { get; } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Infrastructure.Data.Core/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Infrastructure.CrossCutting.IoC/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext/Repositories/ERPModule/AddressRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Infrastructure.Data.BoundedContext.ERPModule 2 | { 3 | using Domain.BoundedContext.ERPModule; 4 | using Infrastructure.Data.Core; 5 | using Infrastructure.Data.BoundedContext.UnitOfWork; 6 | using Infrastructure.CrossCutting.Core; 7 | /// 8 | /// The Address repository implementation 9 | /// 10 | public class AddressRepository 11 | : Repository
, IAddressRepository 12 | { 13 | #region Constructor 14 | 15 | /// 16 | /// Create a new instance 17 | /// 18 | /// Associated unit Of Work 19 | /// Associated logger 20 | public AddressRepository(IMainBCUnitOfWork unitOfWork, ILogger logger) 21 | : base(unitOfWork, logger) 22 | { 23 | } 24 | 25 | #endregion 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext/Repositories/ERPModule/CustomerRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Infrastructure.Data.BoundedContext.ERPModule 2 | { 3 | using Domain.BoundedContext.ERPModule; 4 | using Infrastructure.CrossCutting.Core; 5 | using Infrastructure.Data.BoundedContext.UnitOfWork; 6 | using Infrastructure.Data.Core; 7 | /// 8 | /// The Customer repository implementation 9 | /// 10 | public class CustomerRepository 11 | : Repository, ICustomerRepository 12 | { 13 | #region Constructor 14 | 15 | /// 16 | /// Create a new instance 17 | /// 18 | /// Associated unit of work 19 | /// Associated logger 20 | public CustomerRepository(IMainBCUnitOfWork unitOfWork, ILogger logger) 21 | : base(unitOfWork, logger) 22 | { 23 | } 24 | 25 | #endregion 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext/Repositories/ERPModule/EmployeeRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Infrastructure.Data.BoundedContext.ERPModule 2 | { 3 | using Domain.BoundedContext.ERPModule; 4 | using Infrastructure.Data.Core; 5 | using Infrastructure.Data.BoundedContext.UnitOfWork; 6 | using Infrastructure.CrossCutting.Core; 7 | /// 8 | /// The Employee repository implementation 9 | /// 10 | public class EmployeeRepository 11 | : Repository, IEmployeeRepository 12 | { 13 | #region Constructor 14 | 15 | /// 16 | /// Create a new instance 17 | /// 18 | /// Associated unit of work 19 | /// Associated logger 20 | public EmployeeRepository(IMainBCUnitOfWork unitOfWork, ILogger logger) 21 | : base(unitOfWork, logger) 22 | { 23 | } 24 | 25 | #endregion 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext/Repositories/MembershipModule/RoleRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Infrastructure.Data.BoundedContext.MembershipModule 2 | { 3 | using Domain.BoundedContext.MembershipModule; 4 | using Infrastructure.Data.Core; 5 | using Infrastructure.Data.BoundedContext.UnitOfWork; 6 | using Infrastructure.CrossCutting.Core; 7 | /// 8 | /// The User repository implementation 9 | /// 10 | public class RoleRepository 11 | : Repository, IRoleRepository 12 | { 13 | #region Constructor 14 | 15 | /// 16 | /// Create a new instance 17 | /// 18 | /// Associated unit of work 19 | /// Associated logger 20 | public RoleRepository(IMainBCUnitOfWork unitOfWork, ILogger logger) 21 | : base(unitOfWork, logger) 22 | { 23 | } 24 | 25 | #endregion 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Application.BoundedContext.Tests/Managers/OrganizationManagementServiceTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using Microsoft.VisualStudio.TestTools.UnitTesting; 4 | using Application.BoundedConext.ERPModule; 5 | using Infrastructure.CrossCutting.IoC; 6 | using System.Collections.Generic; 7 | using Domain.BoundedContext.ERPModule; 8 | using System.Threading.Tasks; 9 | 10 | namespace Application.BoundedConext.Tests.Managers 11 | { 12 | [TestClass] 13 | public class OrganizationManagementServiceTests 14 | { 15 | [TestMethod] 16 | public async Task OrganizationManagementServiceTests_GetAllFacilitiesAsync_Tests() 17 | { 18 | IOrganizationManagementService service = IoCFactory.Instance.CurrentContainer.Resolve(); 19 | IEnumerable orgs =await service.GetAllFacilitiesAsync(); 20 | Assert.IsNotNull(orgs); 21 | Assert.IsTrue(orgs.Count() > 0); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Application.BoundedContext/ERPModule/IOrganizationManagementService.cs: -------------------------------------------------------------------------------- 1 | namespace Application.BoundedConext.ERPModule 2 | { 3 | using Domain.BoundedContext.ERPModule; 4 | using System.Collections.Generic; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | 8 | public interface IOrganizationManagementService 9 | { 10 | /// 11 | /// 12 | /// 13 | /// 14 | /// 15 | /// 16 | Task AddAsync(Organization organization, CancellationToken cancellationToken = default(CancellationToken)); 17 | 18 | /// 19 | /// 20 | /// 21 | /// 22 | /// 23 | Task> GetAllFacilitiesAsync( CancellationToken cancellationToken = default(CancellationToken)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext/Repositories/ERPModule/PositionRepository.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace Infrastructure.Data.BoundedContext.ERPModule 3 | { 4 | using Domain.BoundedContext.ERPModule; 5 | using Infrastructure.Data.Core; 6 | using Infrastructure.Data.BoundedContext.UnitOfWork; 7 | using Infrastructure.CrossCutting.Core; 8 | /// 9 | /// The Position repository implementation 10 | /// 11 | public class PositionRepository 12 | : Repository, IPositionRepository 13 | { 14 | #region Constructor 15 | 16 | /// 17 | /// Create a new instance 18 | /// 19 | /// Associated unit of work 20 | /// Associated logger 21 | public PositionRepository(IMainBCUnitOfWork unitOfWork, ILogger logger) 22 | : base(unitOfWork, logger) 23 | { 24 | } 25 | 26 | #endregion 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNet.Identity 2 | @if (Request.IsAuthenticated) 3 | { 4 | using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" })) 5 | { 6 | @Html.AntiForgeryToken() 7 | 8 | 14 | } 15 | } 16 | else 17 | { 18 | 22 | } 23 | -------------------------------------------------------------------------------- /Domain.BoundedContext/StoreModule/Equipment/EquipmentAggregate.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.StoreModule 2 | { 3 | using System; 4 | using System.ComponentModel.DataAnnotations; 5 | using Domain.Core; 6 | 7 | public class EquipmentAggregate:EntityBase 8 | { 9 | 10 | /// 11 | /// Get or Set DepartmentId 12 | /// 13 | public Guid DepartmentId { get; set; } 14 | 15 | /// 16 | /// Get or set the Department name 17 | /// 18 | public string DepartmentName { get; set; } 19 | 20 | /// 21 | /// Get or set the name 22 | /// 23 | public string Name { get; set; } 24 | 25 | /// 26 | /// 27 | /// 28 | public string Model { get; set; } 29 | 30 | /// 31 | /// 32 | /// 33 | public string Description { get; set; } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext/Repositories/ERPModule/DepartmentRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Infrastructure.Data.BoundedContext.ERPModule 2 | { 3 | using Domain.BoundedContext.ERPModule; 4 | using Infrastructure.Data.Core; 5 | using Infrastructure.Data.BoundedContext.UnitOfWork; 6 | using Infrastructure.CrossCutting.Core; 7 | /// 8 | /// The Department repository implementation 9 | /// 10 | public class DepartmentRepository 11 | : Repository, IDepartmentRepository 12 | { 13 | #region Constructor 14 | 15 | /// 16 | /// Create a new instance 17 | /// 18 | /// Associated unit of work 19 | /// Associated logger 20 | public DepartmentRepository(IMainBCUnitOfWork unitOfWork, ILogger logger) 21 | : base(unitOfWork, logger) 22 | { 23 | } 24 | 25 | #endregion 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext/Repositories/MembershipModule/ProfileRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Infrastructure.Data.BoundedContext.MembershipModule 2 | { 3 | using Domain.BoundedContext.MembershipModule; 4 | using Infrastructure.Data.Core; 5 | using Infrastructure.Data.BoundedContext.UnitOfWork; 6 | using Infrastructure.CrossCutting.Core; 7 | /// 8 | /// The User repository implementation 9 | /// 10 | public class ProfileRepository 11 | : Repository, IProfileRepository 12 | { 13 | #region Constructor 14 | 15 | /// 16 | /// Create a new instance 17 | /// 18 | /// Associated unit of work 19 | /// Associated logger 20 | public ProfileRepository(IMainBCUnitOfWork unitOfWork, ILogger logger) 21 | : base(unitOfWork, logger) 22 | { 23 | } 24 | 25 | #endregion 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext/Repositories/ERPModule/OrganizationRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Infrastructure.Data.BoundedContext.ERPModule 2 | { 3 | using Domain.BoundedContext.ERPModule; 4 | using Infrastructure.CrossCutting.Core; 5 | using Infrastructure.Data.BoundedContext.UnitOfWork; 6 | using Infrastructure.Data.Core; 7 | /// 8 | /// The Organization repository implementation 9 | /// 10 | public class OrganizationRepository 11 | : Repository, IOrganizationRepository 12 | { 13 | #region Constructor 14 | 15 | /// 16 | /// Create a new instance 17 | /// 18 | /// Associated unit of work 19 | /// Associated logger 20 | public OrganizationRepository(IMainBCUnitOfWork unitOfWork, ILogger logger) 21 | : base(unitOfWork, logger) 22 | { 23 | } 24 | 25 | #endregion 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Extensions/IoCControllerFactory.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | namespace Pedago.ASP.NET.MVC5.Client.Extension 4 | { 5 | using Infrastructure.CrossCutting.Core; 6 | using System; 7 | using System.Web.Mvc; 8 | using System.Web.Routing; 9 | public class IoCControllerFactory : DefaultControllerFactory 10 | { 11 | private IContainer _Container; 12 | 13 | public IoCControllerFactory(IContainer container) 14 | { 15 | if (container == null) 16 | throw new ArgumentNullException("serviceFactory"); 17 | this._Container = container; 18 | } 19 | 20 | protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType) 21 | { 22 | if (controllerType != (Type)null) 23 | return this._Container.Resolve(controllerType) as IController; 24 | else 25 | return base.GetControllerInstance(requestContext, controllerType); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Application.BoundedContext.Tests/Managers/EquipmentAggregateManagementServiceTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using Microsoft.VisualStudio.TestTools.UnitTesting; 4 | using Application.BoundedConext.StoreModule; 5 | using System.Collections.Generic; 6 | using Domain.BoundedContext.StoreModule; 7 | using System.Threading.Tasks; 8 | using Infrastructure.CrossCutting.IoC; 9 | 10 | namespace Application.BoundedConext.Tests.Managers 11 | { 12 | [TestClass] 13 | public class EquipmentAggregateManagementServiceTests 14 | { 15 | [TestMethod] 16 | public async Task EquipmentAggregateManagementServiceTests_GetAllTests() 17 | { 18 | IEquipmentAggregateManagementService service = IoCFactory.Instance.CurrentContainer.Resolve(); 19 | IEnumerable orgs = await service.GetAllEquipmentAsync(); 20 | Assert.IsNotNull(orgs); 21 | Assert.IsTrue(orgs.Count() > 0); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext/Repositories/MembershipModule/UserRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Infrastructure.Data.BoundedContext.MembershipModule.Repositories 2 | { 3 | using Domain.BoundedContext.MembershipModule; 4 | using Infrastructure.CrossCutting.Core; 5 | using Infrastructure.Data.BoundedContext.UnitOfWork; 6 | using Infrastructure.Data.Core; 7 | /// 8 | /// The User repository implementation 9 | /// 10 | public class UserRepository 11 | : Repository, IUserRepository 12 | { 13 | #region Constructor 14 | 15 | /// 16 | /// Create a new instance 17 | /// 18 | /// Associated unit of work 19 | /// Associated logger 20 | public UserRepository(IMainBCUnitOfWork unitOfWork, ILogger logger) 21 | : base(unitOfWork, logger) 22 | { 23 | 24 | } 25 | 26 | #endregion 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Facility/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET.MVC5.Client.Models.FacilityListViewModel 2 | @{ 3 | ViewBag.Title = "Index"; 4 | } 5 | 6 |

Facilities

7 | @Html.ActionLink("Create", "Create", "facility", new { @class = "btn btn-primary btn-lg pull-right",id="facilityCreate" }) 8 |

Total : @Model.Total

9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | @foreach (var f in @Model.Facilities) 21 | { 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | } 30 | 31 |
IdFacility NameFacility AddressFacility CityFacility Zip code
@f.Id@f.Name@f.Address@f.City@f.ZipCode
32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext/Repositories/BlobAggregates/BlobAggregateRepository.cs: -------------------------------------------------------------------------------- 1 | using Domain.BoundedContext.BlobAggregates; 2 | using Infrastructure.CrossCutting.Core; 3 | using Infrastructure.Data.BoundedContext.UnitOfWork; 4 | using Infrastructure.Data.Core; 5 | namespace Infrastructure.Data.BoundedContext.BlobAggregates 6 | { 7 | 8 | /// 9 | /// The Comment repository implementation 10 | /// 11 | public class BlobAggregateRepository 12 | : Repository, IBlobAggregateRepository 13 | { 14 | #region Constructor 15 | 16 | /// 17 | /// Create a new instance 18 | /// 19 | /// Associated unit of work 20 | /// Associated logger 21 | public BlobAggregateRepository(IAzureBlobUnitOfWork unitOfWork, ILogger logger) 22 | : base(unitOfWork, logger) 23 | { 24 | } 25 | 26 | #endregion 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Manage/AddPhoneNumber.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET.MVC5.Client.Models.AddPhoneNumberViewModel 2 | @{ 3 | ViewBag.Title = "Phone Number"; 4 | } 5 | 6 |

@ViewBag.Title.

7 | 8 | @using (Html.BeginForm("AddPhoneNumber", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 9 | { 10 | @Html.AntiForgeryToken() 11 |

Add a phone number

12 |
13 | @Html.ValidationSummary("", new { @class = "text-danger" }) 14 |
15 | @Html.LabelFor(m => m.Number, new { @class = "col-md-2 control-label" }) 16 |
17 | @Html.TextBoxFor(m => m.Number, new { @class = "form-control" }) 18 |
19 |
20 |
21 |
22 | 23 |
24 |
25 | } 26 | 27 | @section Scripts { 28 | @Scripts.Render("~/bundles/jqueryval") 29 | } 30 | -------------------------------------------------------------------------------- /Application.BoundedContext/StoreModule/IEquipmentAggregateManagementService.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace Application.BoundedConext.StoreModule 3 | { 4 | using Domain.BoundedContext.StoreModule; 5 | using System.Collections.Generic; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | public interface IEquipmentAggregateManagementService 9 | { 10 | /// 11 | /// 12 | /// 13 | /// 14 | /// 15 | /// 16 | Task AddEquipmentAsync(EquipmentAggregate equipmentAggregate, CancellationToken cancellationToken = default(CancellationToken)); 17 | 18 | /// 19 | /// 20 | /// 21 | /// 22 | /// 23 | Task> GetAllEquipmentAsync(CancellationToken cancellationToken = default(CancellationToken)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Account/ForgotPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET.MVC5.Client.Models.ForgotPasswordViewModel 2 | @{ 3 | ViewBag.Title = "Forgot your password?"; 4 | } 5 | 6 |

@ViewBag.Title.

7 | 8 | @using (Html.BeginForm("ForgotPassword", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 9 | { 10 | @Html.AntiForgeryToken() 11 |

Enter your email.

12 |
13 | @Html.ValidationSummary("", new { @class = "text-danger" }) 14 |
15 | @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) 16 |
17 | @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) 18 |
19 |
20 |
21 |
22 | 23 |
24 |
25 | } 26 | 27 | @section Scripts { 28 | @Scripts.Render("~/bundles/jqueryval") 29 | } 30 | -------------------------------------------------------------------------------- /Application.BoundedContext/ERPModule/IDepartmentAggregateManagementService.cs: -------------------------------------------------------------------------------- 1 | using Domain.BoundedContext.ERPModule; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | 9 | namespace Application.BoundedConext.ERPModule 10 | { 11 | public interface IDepartmentAggregateManagementService 12 | { 13 | /// 14 | /// 15 | /// 16 | /// 17 | /// 18 | /// 19 | Task AddDepartmentAsync(DepartmentAggregate department, CancellationToken cancellationToken = default(CancellationToken)); 20 | 21 | /// 22 | /// 23 | /// 24 | /// 25 | /// 26 | Task> GetAllDepartmentsAsync(CancellationToken cancellationToken = default(CancellationToken)); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Equipment/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET.MVC5.Client.Models.EquipmentListViewModel 2 | @{ 3 | ViewBag.Title = "Index"; 4 | } 5 | 6 |

All equipment

7 | @Html.ActionLink("Create", "Create", "Equipment", new { @class = "btn btn-primary btn-lg pull-right" }) 8 |

Total : @Model.Total

9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | @foreach (var f in @Model.Equipment) 22 | { 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | } 32 | 33 |
IdEquipment NameDepartment NameModelCreation dateDescription
@f.Id@f.Name@f.DepartmentName@f.EquipmentModel@f.CreationDate@f.Description
34 | -------------------------------------------------------------------------------- /Domain.BoundedContext/ERPModule/Position/Position.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.ERPModule 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel.DataAnnotations; 6 | using Domain.Core; 7 | using System.ComponentModel.DataAnnotations.Schema; 8 | using Domain.BoundedContext.Resources; 9 | 10 | /// 11 | /// Aggregate root for Position Aggregate. 12 | /// 13 | [Table("Positions")] 14 | public class Position 15 | : EntityBase 16 | { 17 | 18 | #region Members 19 | 20 | #endregion 21 | 22 | #region Properties 23 | 24 | 25 | /// 26 | /// Get or set the Given name of this customer 27 | /// 28 | [Required(ErrorMessageResourceName = "PositionTitleRequired", ErrorMessageResourceType = typeof(Messages))] 29 | [MaxLength(50, ErrorMessageResourceName = "PositionTitleMaxLength", ErrorMessageResourceType = typeof(Messages))] 30 | public string Title { get; set; } 31 | 32 | 33 | #endregion 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Manage/VerifyPhoneNumber.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET.MVC5.Client.Models.VerifyPhoneNumberViewModel 2 | @{ 3 | ViewBag.Title = "Verify Phone Number"; 4 | } 5 | 6 |

@ViewBag.Title.

7 | 8 | @using (Html.BeginForm("VerifyPhoneNumber", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 9 | { 10 | @Html.AntiForgeryToken() 11 | @Html.Hidden("phoneNumber", @Model.PhoneNumber) 12 |

Enter verification code

13 |
@ViewBag.Status
14 |
15 | @Html.ValidationSummary("", new { @class = "text-danger" }) 16 |
17 | @Html.LabelFor(m => m.Code, new { @class = "col-md-2 control-label" }) 18 |
19 | @Html.TextBoxFor(m => m.Code, new { @class = "form-control" }) 20 |
21 |
22 |
23 |
24 | 25 |
26 |
27 | } 28 | 29 | @section Scripts { 30 | @Scripts.Render("~/bundles/jqueryval") 31 | } 32 | -------------------------------------------------------------------------------- /Infrastructure.Data.Core/DataTableExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using System.Linq; 5 | using System.Reflection; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Infrastructure.Data.Core 10 | { 11 | public static class DataTableExtensions 12 | { 13 | public static IList ToList(this DataTable table) where T : new() 14 | { 15 | if (table == null) return null; 16 | IList properties = typeof(T).GetProperties().ToList(); 17 | IList result = new List(); 18 | 19 | foreach (var row in table.Rows) 20 | { 21 | var item = CreateItemFromRow((DataRow)row, properties); 22 | result.Add(item); 23 | } 24 | 25 | return result; 26 | } 27 | 28 | private static T CreateItemFromRow(DataRow row, IEnumerable properties) where T : new() 29 | { 30 | T item = new T(); 31 | foreach (var property in properties) 32 | { 33 | property.SetValue(item, row[property.Name], null); 34 | } 35 | return item; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Infrastructure.Data.Core/InMemorySet/InMemoryDbAsyncEnumerator.cs: -------------------------------------------------------------------------------- 1 | namespace Infrastructure.Data.Core 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Data.Entity.Infrastructure; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | 9 | internal class InMemoryDbAsyncEnumerator : IDbAsyncEnumerator, IDbAsyncEnumerator, IDisposable 10 | { 11 | private readonly IEnumerator _inner; 12 | 13 | public T Current 14 | { 15 | get 16 | { 17 | return this._inner.Current; 18 | } 19 | } 20 | 21 | object IDbAsyncEnumerator.Current 22 | { 23 | get 24 | { 25 | return (object)this.Current; 26 | } 27 | } 28 | 29 | public InMemoryDbAsyncEnumerator(IEnumerator inner) 30 | { 31 | this._inner = inner; 32 | } 33 | 34 | public void Dispose() 35 | { 36 | this._inner.Dispose(); 37 | } 38 | 39 | public Task MoveNextAsync(CancellationToken cancellationToken) 40 | { 41 | return Task.FromResult(this._inner.MoveNext()); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Domain.BoundedContext/MembershipModule/Profile/Profile.cs: -------------------------------------------------------------------------------- 1 | //=================================================================================== 2 | // 3 | //=================================================================================== 4 | // 5 | // 6 | // 7 | //=================================================================================== 8 | // 9 | // 10 | // 11 | //=================================================================================== 12 | 13 | namespace Domain.BoundedContext.MembershipModule 14 | { 15 | using Domain.Core; 16 | using System; 17 | using System.Collections.Generic; 18 | using System.ComponentModel.DataAnnotations; 19 | using System.ComponentModel.DataAnnotations.Schema; 20 | /// 21 | /// Application Profile information 22 | /// 23 | [Table("Profiles")] 24 | public class Profile : EntityBase 25 | { 26 | 27 | #region Properties 28 | 29 | /// 30 | /// Get or set PropertyName 31 | /// 32 | public string PropertyName { get; set; } 33 | 34 | /// 35 | /// Get or set PropertyValue 36 | /// 37 | public string PropertyValue { get; set; } 38 | 39 | #endregion 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Account/_ExternalLoginsListPartial.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET.MVC5.Client.Models.ExternalLoginListViewModel 2 | @using Microsoft.Owin.Security 3 | 4 |

Use another service to log in.

5 |
6 | @{ 7 | var loginProviders = Context.GetOwinContext().Authentication.GetExternalAuthenticationTypes(); 8 | if (loginProviders.Count() == 0) { 9 |
10 |

11 | There are no external authentication services configured. See this article 12 | for details on setting up this ASP.NET application to support logging in via external services. 13 |

14 |
15 | } 16 | else { 17 | using (Html.BeginForm("ExternalLogin", "Account", new { ReturnUrl = Model.ReturnUrl })) { 18 | @Html.AntiForgeryToken() 19 |
20 |

21 | @foreach (AuthenticationDescription p in loginProviders) { 22 | 23 | } 24 |

25 |
26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Account/_SetPasswordPartial.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET.MVC5.Client.Models.ManageUserViewModel 2 | 3 | @using (Html.BeginForm("Manage", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 4 | { 5 |

6 | You do not have a local username/password for this site. Add a local 7 | account so you can log in without an external login. 8 |

9 | @Html.AntiForgeryToken() 10 | 11 |

Create Local Login

12 |
13 | @Html.ValidationSummary("", new { @class = "text-danger" }) 14 |
15 | @Html.LabelFor(m => m.NewPassword, new { @class = "col-md-2 control-label" }) 16 |
17 | @Html.PasswordFor(m => m.NewPassword, new { @class = "form-control" }) 18 |
19 |
20 |
21 | @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) 22 |
23 | @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) 24 |
25 |
26 |
27 |
28 | 29 |
30 |
31 | } 32 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext.Test/Repositories/DepartmentAggregateRepositoryTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | using Domain.BoundedContext.ERPModule; 4 | using Infrastructure.CrossCutting.IoC; 5 | using System.Linq; 6 | 7 | namespace Infrastructure.Data.BoundedContext.Tests.Repositories 8 | { 9 | [TestClass] 10 | public class DepartmentAggregateRepositoryTests 11 | { 12 | 13 | [TestMethod] 14 | public void DepartmentAggregateRepository_GetByIdValidIdTest() 15 | { 16 | Guid guid = new Guid("62588897-8e83-cf15-3239-08d20141829a"); 17 | IDepartmentAggregateRepository repo = IoCFactory.Instance.CurrentContainer.Resolve(); 18 | DepartmentAggregate dep = repo.GetElementById(guid); 19 | Assert.IsNotNull(dep); 20 | Assert.IsTrue(dep.Id == guid); 21 | } 22 | [TestMethod] 23 | public void DepartmentAggregateRepositoryTests_GetAllTest() 24 | { 25 | IDepartmentAggregateRepository repo = IoCFactory.Instance.CurrentContainer.Resolve(); 26 | IQueryable all = repo.GetAllElements(); 27 | Assert.IsNotNull(all); 28 | Assert.IsTrue(all.Any()); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Domain.BoundedContext/MembershipModule/Claim/Claim.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace Domain.BoundedContext.MembershipModule 3 | { 4 | using Domain.Core; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.ComponentModel.DataAnnotations; 8 | using System.ComponentModel.DataAnnotations.Schema; 9 | /// 10 | /// Application Claim information 11 | /// 12 | [Table("Claims")] 13 | public class Claim : EntityBase 14 | { 15 | 16 | #region Properties 17 | 18 | /// 19 | /// Claim type 20 | /// 21 | public virtual string ClaimType { get; set; } 22 | 23 | /// 24 | /// Claim value 25 | /// 26 | public virtual string ClaimValue { get; set; } 27 | 28 | /// 29 | /// Claim value 30 | /// 31 | public virtual string Description { get; set; } 32 | 33 | /// 34 | /// Get or set User Id for the user who owns this claim 35 | /// 36 | public Guid UserId { get; set; } 37 | /// 38 | /// User for the user who owns this login 39 | /// 40 | [ForeignKey("UserId")] 41 | public virtual User User { get; set; } 42 | 43 | 44 | #endregion 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Account/_RemoveAccountPartial.cshtml: -------------------------------------------------------------------------------- 1 | @model ICollection 2 | 3 | @if (Model.Count > 0) 4 | { 5 |

Registered Logins

6 | 7 | 8 | @foreach (var account in Model) 9 | { 10 | 11 | 12 | 30 | 31 | } 32 | 33 |
@account.LoginProvider 13 | @if (ViewBag.ShowRemoveButton) 14 | { 15 | using (Html.BeginForm("Disassociate", "Account")) 16 | { 17 | @Html.AntiForgeryToken() 18 |
19 | @Html.Hidden("loginProvider", account.LoginProvider) 20 | @Html.Hidden("providerKey", account.ProviderKey) 21 | 22 |
23 | } 24 | } 25 | else 26 | { 27 | @:   28 | } 29 |
34 | } 35 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Extensions/UnityWebResolver.cs: -------------------------------------------------------------------------------- 1 | using Infrastructure.CrossCutting.Core; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Web.Mvc; 5 | 6 | namespace Pedago.ASP.NET.MVC5.Client.Extension 7 | { 8 | public class UnityWebResolver : IDependencyResolver 9 | { 10 | protected IContainer _Container; 11 | 12 | public UnityWebResolver(IContainer container) 13 | { 14 | if (container == null) 15 | throw new ArgumentNullException("container"); 16 | this._Container = container; 17 | } 18 | 19 | public object GetService(Type serviceType) 20 | { 21 | try 22 | { 23 | return this._Container.Resolve(serviceType); 24 | } 25 | catch (Exception ex) 26 | { 27 | return (object)null; 28 | } 29 | } 30 | 31 | public IEnumerable GetServices(Type serviceType) 32 | { 33 | try 34 | { 35 | return this._Container.ResolveAll(serviceType); 36 | } 37 | catch (Exception ex) 38 | { 39 | return (IEnumerable)new List(); 40 | } 41 | } 42 | 43 | public void Dispose() 44 | { 45 | this._Container.Dispose(); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client.Tests/CodedUITests/FacilityControllerTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | using OpenQA.Selenium; 4 | using OpenQA.Selenium.Support.UI; 5 | 6 | namespace ASP.NET.MVC5.Client.Tests.CodedUITests 7 | { 8 | [TestClass] 9 | public class FacilityControllerTests 10 | { 11 | 12 | private string homenUrl = "http://localhost/PolyglotPersistence/"; 13 | private IWebDriver window; 14 | 15 | [TestInitialize] 16 | public void MyTestInitialize() 17 | { 18 | this.window = BrowserSelect.GetConfigBrowser(); 19 | 20 | } 21 | 22 | [TestCleanup] 23 | public void MyTestCleanup() 24 | { 25 | this.window.Close(); 26 | } 27 | 28 | [TestMethod] 29 | public void faciltyListCreateTestDemo() 30 | { 31 | this.window.Navigate().GoToUrl(this.homenUrl); 32 | WebDriverWait webDriverWait = new WebDriverWait(this.window, TimeSpan.FromMilliseconds(1000.0)); 33 | IWebElement loginLink = webDriverWait.Until(ExpectedConditions.ElementIsVisible(By.Id("Facility"))); 34 | loginLink.Click(); 35 | IWebElement Link = webDriverWait.Until(ExpectedConditions.ElementIsVisible(By.Id("facilityCreate"))); 36 | Link.Click(); 37 | 38 | 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Account/VerifyCode.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET.MVC5.Client.Models.VerifyCodeViewModel 2 | @{ 3 | ViewBag.Title = "Verify"; 4 | } 5 | 6 |

@ViewBag.Title.

7 | 8 | @using (Html.BeginForm("VerifyCode", "Account", new { ReturnUrl = Model.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { 9 | @Html.AntiForgeryToken() 10 | @Html.Hidden("provider", @Model.Provider) 11 | @Html.Hidden("rememberMe", @Model.RememberMe) 12 |

Enter verification code

13 |
14 | @Html.ValidationSummary("", new { @class = "text-danger" }) 15 |
16 | @Html.LabelFor(m => m.Code, new { @class = "col-md-2 control-label" }) 17 |
18 | @Html.TextBoxFor(m => m.Code, new { @class = "form-control" }) 19 |
20 |
21 |
22 |
23 |
24 | @Html.CheckBoxFor(m => m.RememberBrowser) 25 | @Html.LabelFor(m => m.RememberBrowser) 26 |
27 |
28 |
29 |
30 |
31 | 32 |
33 |
34 | } 35 | 36 | @section Scripts { 37 | @Scripts.Render("~/bundles/jqueryval") 38 | } 39 | -------------------------------------------------------------------------------- /Domain.BoundedContext/MembershipModule/Logins/Login.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace Domain.BoundedContext.MembershipModule 3 | { 4 | using Domain.Core; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.ComponentModel.DataAnnotations; 8 | using System.ComponentModel.DataAnnotations.Schema; 9 | /// 10 | /// Application Login information 11 | /// 12 | [Table("Logins")] 13 | public class Login : EntityBase 14 | { 15 | 16 | #region Properties 17 | /// 18 | /// The login provider for the login (i.e. facebook, google) 19 | /// 20 | public virtual string LoginProvider { get; set; } 21 | 22 | /// 23 | /// Key representing the login for the provider 24 | /// 25 | public virtual string ProviderKey { get; set; } 26 | 27 | /// 28 | /// Display name for the login 29 | /// 30 | public virtual string ProviderDisplayName { get; set; } 31 | 32 | /// 33 | /// Get or set User id 34 | /// 35 | public Guid UserId { get; set; } 36 | /// 37 | /// User for the user who owns this login 38 | /// 39 | [ForeignKey("UserId")] 40 | public virtual User User { get; set; } 41 | 42 | 43 | #endregion 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /Domain.Core/IdentityGenerator.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.Core 2 | { 3 | using System; 4 | 5 | public static class IdentityGenerator 6 | { 7 | 8 | /// 9 | /// This algorithm generates secuential GUIDs across system boundaries 10 | /// 11 | /// sequential GUID 12 | public static Guid SequentialGuid() 13 | { 14 | byte[] uid = Guid.NewGuid().ToByteArray(); 15 | byte[] binDate = BitConverter.GetBytes(DateTime.UtcNow.Ticks); 16 | 17 | byte[] secuentialGuid = new byte[uid.Length]; 18 | 19 | secuentialGuid[0] = uid[0]; 20 | secuentialGuid[1] = uid[1]; 21 | secuentialGuid[2] = uid[2]; 22 | secuentialGuid[3] = uid[3]; 23 | secuentialGuid[4] = uid[4]; 24 | secuentialGuid[5] = uid[5]; 25 | secuentialGuid[6] = uid[6]; 26 | secuentialGuid[7] = (byte)(0xc0 | (0xf & uid[7])); 27 | secuentialGuid[9] = binDate[0]; 28 | secuentialGuid[8] = binDate[1]; 29 | secuentialGuid[15] = binDate[2]; 30 | secuentialGuid[14] = binDate[3]; 31 | secuentialGuid[13] = binDate[4]; 32 | secuentialGuid[12] = binDate[5]; 33 | secuentialGuid[11] = binDate[6]; 34 | secuentialGuid[10] = binDate[7]; 35 | 36 | return new Guid(secuentialGuid); 37 | } 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Models/DepartmentViewModels.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Web; 6 | using System.Web.Mvc; 7 | 8 | namespace ASP.NET.MVC5.Client.Models 9 | { 10 | public class DepartmentViewModels 11 | { 12 | } 13 | 14 | 15 | public class DepartmentemViewModel 16 | { 17 | public string Id { get; set; } 18 | public string FacilityName { get; set; } 19 | public string Name { get; set; } 20 | public string Description { get; set; } 21 | } 22 | 23 | public class DepartmentListViewModel 24 | { 25 | public int Total { get; set; } 26 | public IEnumerable Departments { get; set; } 27 | } 28 | 29 | public class DepartmentCreateViewModel 30 | { 31 | public string Id { get; set; } 32 | 33 | [Required] 34 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 35 | [Display(Name = "Department Name")] 36 | public string Name { get; set; } 37 | 38 | [Required] 39 | [Display(Name = "Facility Name")] 40 | public string FacilityId { get; set; } 41 | 42 | public IEnumerable FacilitiesModel { get; set; } 43 | 44 | [Required] 45 | [Display(Name = "Description")] 46 | public string Description { get; set; } 47 | } 48 | } -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Account/_ChangePasswordPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using ASP.NET.MVC5.Client.Models 2 | @model Microsoft.AspNet.Identity.ManageUserViewModel 3 | 4 | @using (Html.BeginForm("Manage", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 5 | { 6 | @Html.AntiForgeryToken() 7 |

Change Password Form

8 |
9 | @Html.ValidationSummary("", new { @class = "text-danger" }) 10 |
11 | @Html.LabelFor(m => m.OldPassword, new { @class = "col-md-2 control-label" }) 12 |
13 | @Html.PasswordFor(m => m.OldPassword, new { @class = "form-control" }) 14 |
15 |
16 |
17 | @Html.LabelFor(m => m.NewPassword, new { @class = "col-md-2 control-label" }) 18 |
19 | @Html.PasswordFor(m => m.NewPassword, new { @class = "form-control" }) 20 |
21 |
22 |
23 | @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) 24 |
25 | @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) 26 |
27 |
28 | 29 |
30 |
31 | 32 |
33 |
34 | } 35 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Department/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET.MVC5.Client.Models.DepartmentCreateViewModel 2 | @{ 3 | ViewBag.Title = "Create"; 4 | } 5 | 6 |

Create department

7 | 8 | 9 | 10 | @using (Html.BeginForm("Create", "Department", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 11 | { 12 | @Html.AntiForgeryToken() 13 | 14 |
15 | @Html.ValidationSummary("", new { @class = "text-danger" }) 16 |
17 | @Html.LabelFor(m => m.Name, new { @class = "col-md-2 control-label" }) 18 |
19 | @Html.TextBoxFor(m => m.Name, new { @class = "form-control" }) 20 |
21 |
22 |
23 | @Html.LabelFor(m => m.FacilityId, new { @class = "col-md-2 control-label" }) 24 |
25 | @Html.DropDownListFor(m => m.FacilityId, Model.FacilitiesModel, new { @class = "form-control" }) 26 |
27 |
28 |
29 | @Html.LabelFor(m => m.Description, new { @class = "col-md-2 control-label" }) 30 |
31 | @Html.TextAreaFor(m => m.Description, new { @class = "form-control" }) 32 |
33 |
34 |
35 |
36 | 37 |
38 |
39 | } -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Models/FacilityViewModels.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace ASP.NET.MVC5.Client.Models 8 | { 9 | public class FacilityViewModels 10 | { 11 | } 12 | 13 | public class FacilityItelViewModel 14 | { 15 | public string Id { get; set; } 16 | public string Name { get; set; } 17 | public string Address { get; set; } 18 | public string City { get; set; } 19 | public string ZipCode { get; set; } 20 | } 21 | 22 | 23 | public class FacilityListViewModel 24 | { 25 | public int Total { get; set; } 26 | public IEnumerable Facilities { get; set; } 27 | } 28 | 29 | public class FacilityCreateViewModel 30 | { 31 | 32 | public string Id { get; set; } 33 | [Required] 34 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 35 | [Display(Name = "Facility Name")] 36 | public string Name { get; set; } 37 | 38 | [Required] 39 | [Display(Name = "Facility Address")] 40 | public string Address { get; set; } 41 | 42 | [Required] 43 | [Display(Name = "City")] 44 | public string City { get; set; } 45 | 46 | [Required] 47 | [Display(Name = "Zip Code")] 48 | public string ZipCode { get; set; } 49 | } 50 | } -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Manage/SetPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET.MVC5.Client.Models.SetPasswordViewModel 2 | @{ 3 | ViewBag.Title = "Create Password"; 4 | } 5 | 6 |

@ViewBag.Title.

7 |

8 | You do not have a local username/password for this site. Add a local 9 | account so you can log in without an external login. 10 |

11 | 12 | @using (Html.BeginForm("SetPassword", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 13 | { 14 | @Html.AntiForgeryToken() 15 | 16 |

Create Local Login

17 |
18 | @Html.ValidationSummary("", new { @class = "text-danger" }) 19 |
20 | @Html.LabelFor(m => m.NewPassword, new { @class = "col-md-2 control-label" }) 21 |
22 | @Html.PasswordFor(m => m.NewPassword, new { @class = "form-control" }) 23 |
24 |
25 |
26 | @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) 27 |
28 | @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) 29 |
30 |
31 |
32 |
33 | 34 |
35 |
36 | } 37 | @section Scripts { 38 | @Scripts.Render("~/bundles/jqueryval") 39 | } -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client.Tests/Controllers/EquipmentControllerTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | using System.Web; 4 | using System.Collections.Generic; 5 | using System.IO; 6 | using ASP.NET.MVC5.Client.Controllers; 7 | using System.Web.Mvc; 8 | using Infrastructure.CrossCutting.IoC; 9 | using System.Threading.Tasks; 10 | 11 | namespace ASP.NET.MVC5.Client.Tests.Controllers 12 | { 13 | [TestClass] 14 | public class EquipmentControllerTests 15 | { 16 | [TestInitialize] 17 | public void Setup() 18 | { 19 | HttpContext.Current = new HttpContext(new HttpRequest("", "http://tempuri.org", ""), new HttpResponse((TextWriter)new StringWriter())); 20 | HttpContext.Current.Items.Add("owin.Environment", new Dictionary() 21 | { 22 | { 23 | "owin.RequestBody", 24 | null 25 | } 26 | }); 27 | 28 | BootStrapper.Start(); 29 | } 30 | 31 | 32 | 33 | [TestMethod] 34 | public async Task EquipmentController_Index_Test() 35 | { 36 | // Arrange 37 | EquipmentController controller = IoCFactory.Instance.CurrentContainer.Resolve(); ; 38 | 39 | // Act 40 | ViewResult result =await controller.Index() as ViewResult; 41 | 42 | // Assert 43 | Assert.IsNotNull(result); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Account/ExternalLoginConfirmation.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET.MVC5.Client.Models.ExternalLoginConfirmationViewModel 2 | @{ 3 | ViewBag.Title = "Register"; 4 | } 5 |

@ViewBag.Title.

6 |

Associate your @ViewBag.LoginProvider account.

7 | 8 | @using (Html.BeginForm("ExternalLoginConfirmation", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 9 | { 10 | @Html.AntiForgeryToken() 11 | 12 |

Association Form

13 |
14 | @Html.ValidationSummary(true, "", new { @class = "text-danger" }) 15 |

16 | You've successfully authenticated with @ViewBag.LoginProvider. 17 | Please enter a user name for this site below and click the Register button to finish 18 | logging in. 19 |

20 |
21 | @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) 22 |
23 | @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) 24 | @Html.ValidationMessageFor(m => m.Email, "", new { @class = "text-danger" }) 25 |
26 |
27 |
28 |
29 | 30 |
31 |
32 | } 33 | 34 | @section Scripts { 35 | @Scripts.Render("~/bundles/jqueryval") 36 | } 37 | -------------------------------------------------------------------------------- /Domain.BoundedContext/ERPModule/Address/Address.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.ERPModule 2 | { 3 | using Domain.BoundedContext.Resources; 4 | using Domain.Core; 5 | using System.ComponentModel.DataAnnotations; 6 | using System.ComponentModel.DataAnnotations.Schema; 7 | 8 | 9 | /// 10 | /// Address information 11 | /// 12 | [Table("Addresses")] 13 | public class Address : EntityBase 14 | { 15 | 16 | #region Properties 17 | 18 | /// 19 | /// Get or set the city of this address 20 | /// 21 | [Required(ErrorMessageResourceName = "AddressCityRequired", ErrorMessageResourceType = typeof(Messages))] 22 | public string City { get; set; } 23 | 24 | /// 25 | /// Get or set the zip code 26 | /// 27 | 28 | public string ZipCode { get; set; } 29 | 30 | /// 31 | /// Get or set address line 1 32 | /// 33 | public string AddressLine1 { get; set; } 34 | 35 | /// 36 | /// Get or set address line 2 37 | /// 38 | public string AddressLine2 { get; set; } 39 | 40 | /// 41 | /// Get or set CountryGeoId 42 | /// 43 | [Required(ErrorMessageResourceName = "AddressCountryRequired", ErrorMessageResourceType = typeof(Messages))] 44 | public int CountryGeoId { get; set; } 45 | 46 | #endregion 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Helpers/HtmlHelperStaticContentAzure.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.WindowsAzure; 2 | using Microsoft.WindowsAzure.Storage; 3 | using System; 4 | 5 | namespace System.Web.Mvc 6 | { 7 | public static class HtmlHelperStaticContent 8 | { 9 | public static string StaticContentStorageConnectionString 10 | { 11 | get 12 | { 13 | return CloudConfigurationManager.GetSetting("StaticContent.StorageConnectionString"); 14 | } 15 | } 16 | public static string StaticContentContainer 17 | { 18 | get 19 | { 20 | return CloudConfigurationManager.GetSetting("StaticContent.Container"); 21 | } 22 | } 23 | public static string StaticContentBaseUrl 24 | { 25 | get 26 | { 27 | var account = CloudStorageAccount.Parse(StaticContentStorageConnectionString); 28 | return string.Format("{0}/{1}", account.BlobEndpoint.ToString().TrimEnd('/'), StaticContentContainer.TrimStart('/')); 29 | } 30 | } 31 | 32 | public static string CdnContentUrl(this UrlHelper url, string contentPath) 33 | { 34 | if (contentPath.StartsWith("~")) 35 | { 36 | contentPath = contentPath.Substring(1); 37 | } 38 | 39 | contentPath = string.Format("{0}/{1}", StaticContentBaseUrl.TrimEnd('/'), contentPath.TrimStart('/')); 40 | return url.Content(contentPath); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ASP.NET.MVC5.Client")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("General Electric")] 12 | [assembly: AssemblyProduct("ASP.NET.MVC5.Client")] 13 | [assembly: AssemblyCopyright("Copyright © General Electric 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("b4f28067-979c-4aca-8814-5bb079a47126")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Account/Register.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET.MVC5.Client.Models.RegisterViewModel 2 | @{ 3 | ViewBag.Title = "Register"; 4 | } 5 | 6 |

@ViewBag.Title.

7 | 8 | @using (Html.BeginForm("Register", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 9 | { 10 | @Html.AntiForgeryToken() 11 |

Create a new account.

12 |
13 | @Html.ValidationSummary("", new { @class = "text-danger" }) 14 |
15 | @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) 16 |
17 | @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) 18 |
19 |
20 |
21 | @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) 22 |
23 | @Html.PasswordFor(m => m.Password, new { @class = "form-control" }) 24 |
25 |
26 |
27 | @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) 28 |
29 | @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) 30 |
31 |
32 |
33 |
34 | 35 |
36 |
37 | } 38 | 39 | @section Scripts { 40 | @Scripts.Render("~/bundles/jqueryval") 41 | } 42 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client.Tests/Controllers/HomeControllerTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Web.Mvc; 6 | using Microsoft.VisualStudio.TestTools.UnitTesting; 7 | using ASP.NET.MVC5.Client; 8 | using ASP.NET.MVC5.Client.Controllers; 9 | 10 | namespace ASP.NET.MVC5.Client.Tests.Controllers 11 | { 12 | [TestClass] 13 | public class HomeControllerTest 14 | { 15 | [TestMethod] 16 | public void Index() 17 | { 18 | // Arrange 19 | HomeController controller = new HomeController(); 20 | 21 | // Act 22 | ViewResult result = controller.Index() as ViewResult; 23 | 24 | // Assert 25 | Assert.IsNotNull(result); 26 | } 27 | 28 | [TestMethod] 29 | public void About() 30 | { 31 | // Arrange 32 | HomeController controller = new HomeController(); 33 | 34 | // Act 35 | ViewResult result = controller.About() as ViewResult; 36 | 37 | // Assert 38 | Assert.AreEqual("Your application description page.", result.ViewBag.Message); 39 | } 40 | 41 | [TestMethod] 42 | public void Contact() 43 | { 44 | // Arrange 45 | HomeController controller = new HomeController(); 46 | 47 | // Act 48 | ViewResult result = controller.Contact() as ViewResult; 49 | 50 | // Assert 51 | Assert.IsNotNull(result); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ASP.NET.MVC5.Client.Tests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("General Electric")] 12 | [assembly: AssemblyProduct("ASP.NET.MVC5.Client.Tests")] 13 | [assembly: AssemblyCopyright("Copyright © General Electric 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("91068568-92d6-4904-90e6-3acd895d5eec")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Domain.Core/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Domain.Core")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("General Electric")] 12 | [assembly: AssemblyProduct("Domain.Core")] 13 | [assembly: AssemblyCopyright("Copyright © General Electric 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("8318d05a-e2a8-4312-85d0-854d04355b36")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Domain.BoundedContext/MembershipModule/Role/Role.cs: -------------------------------------------------------------------------------- 1 | //=================================================================================== 2 | // 3 | //=================================================================================== 4 | // 5 | // 6 | // 7 | //=================================================================================== 8 | // 9 | // 10 | // 11 | //=================================================================================== 12 | 13 | namespace Domain.BoundedContext.MembershipModule 14 | { 15 | using Domain.Core; 16 | using System.Collections.Generic; 17 | using System.ComponentModel.DataAnnotations; 18 | using System.ComponentModel.DataAnnotations.Schema; 19 | /// 20 | /// Application Role information 21 | /// 22 | [Table("Roles")] 23 | public class Role : EntityBase 24 | { 25 | 26 | #region Properties 27 | 28 | /// 29 | /// Get or set Role Name 30 | /// 31 | [Required(ErrorMessageResourceName = "RoleNameRequired", ErrorMessageResourceType = typeof(Resources.Messages))] 32 | public string Name { get; set; } 33 | 34 | /// 35 | /// Get or set User associated with this role 36 | /// 37 | public ICollection Users { get; set; } 38 | 39 | /// 40 | /// Navigation property for claims in the role 41 | /// 42 | public virtual ICollection Claims { get; set; } 43 | 44 | #endregion 45 | 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /Application.Core/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Application.Core")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("General Electric")] 12 | [assembly: AssemblyProduct("Application.Core")] 13 | [assembly: AssemblyCopyright("Copyright © General Electric 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("0c6b85fc-4d93-421f-9c71-2d94b0151c80")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Domain.Core.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Domain.Core.Tests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("General Electric")] 12 | [assembly: AssemblyProduct("Domain.Core.Tests")] 13 | [assembly: AssemblyCopyright("Copyright © General Electric 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("870e0e74-6bd8-4b16-aaf7-c4b65981087c")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Manage/ChangePassword.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET.MVC5.Client.Models.ChangePasswordViewModel 2 | @{ 3 | ViewBag.Title = "Change Password"; 4 | } 5 | 6 |

@ViewBag.Title.

7 | 8 | @using (Html.BeginForm("ChangePassword", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 9 | { 10 | @Html.AntiForgeryToken() 11 |

Change Password Form

12 |
13 | @Html.ValidationSummary("", new { @class = "text-danger" }) 14 |
15 | @Html.LabelFor(m => m.OldPassword, new { @class = "col-md-2 control-label" }) 16 |
17 | @Html.PasswordFor(m => m.OldPassword, new { @class = "form-control" }) 18 |
19 |
20 |
21 | @Html.LabelFor(m => m.NewPassword, new { @class = "col-md-2 control-label" }) 22 |
23 | @Html.PasswordFor(m => m.NewPassword, new { @class = "form-control" }) 24 |
25 |
26 |
27 | @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) 28 |
29 | @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) 30 |
31 |
32 |
33 |
34 | 35 |
36 |
37 | } 38 | @section Scripts { 39 | @Scripts.Render("~/bundles/jqueryval") 40 | } -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Optimization; 3 | 4 | namespace ASP.NET.MVC5.Client 5 | { 6 | public class BundleConfig 7 | { 8 | // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 9 | public static void RegisterBundles(BundleCollection bundles) 10 | { 11 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include( 12 | "~/Scripts/jquery-{version}.js")); 13 | 14 | bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( 15 | "~/Scripts/jquery.validate*")); 16 | 17 | // Use the development version of Modernizr to develop with and learn from. Then, when you're 18 | // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. 19 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( 20 | "~/Scripts/modernizr-*")); 21 | 22 | bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( 23 | "~/Scripts/bootstrap.js", 24 | "~/Scripts/respond.js")); 25 | 26 | bundles.Add(new StyleBundle("~/Content/css").Include( 27 | "~/Content/bootstrap.css", 28 | "~/Content/site.css")); 29 | 30 | // Set EnableOptimizations to false for debugging. For more information, 31 | // visit http://go.microsoft.com/fwlink/?LinkId=301862 32 | BundleTable.EnableOptimizations = true; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Domain.BoundedContext/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Domain.BoundedContext")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("General Electric")] 12 | [assembly: AssemblyProduct("Domain.BoundedContext")] 13 | [assembly: AssemblyCopyright("Copyright © General Electric 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("0d9c5d60-be8f-4141-bdfb-c31ec6debbf1")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Infrastructure.Data.Core/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Infrastructure.Data.Core")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("General Electric")] 12 | [assembly: AssemblyProduct("Infrastructure.Data.Core")] 13 | [assembly: AssemblyCopyright("Copyright © General Electric 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("83048572-4389-4350-a1c6-b9468d4eafa7")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Application.BoundedContext/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Application.BoundedContext")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("General Electric")] 12 | [assembly: AssemblyProduct("Application.BoundedContext")] 13 | [assembly: AssemblyCopyright("Copyright © General Electric 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("16a8010e-3805-4d5e-a108-66658fea57f4")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Account/ResetPassword.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET.MVC5.Client.Models.ResetPasswordViewModel 2 | @{ 3 | ViewBag.Title = "Reset password"; 4 | } 5 | 6 |

@ViewBag.Title.

7 | 8 | @using (Html.BeginForm("ResetPassword", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 9 | { 10 | @Html.AntiForgeryToken() 11 |

Reset your password.

12 |
13 | @Html.ValidationSummary("", new { @class = "text-danger" }) 14 | @Html.HiddenFor(model => model.Code) 15 |
16 | @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) 17 |
18 | @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) 19 |
20 |
21 |
22 | @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) 23 |
24 | @Html.PasswordFor(m => m.Password, new { @class = "form-control" }) 25 |
26 |
27 |
28 | @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) 29 |
30 | @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) 31 |
32 |
33 |
34 |
35 | 36 |
37 |
38 | } 39 | 40 | @section Scripts { 41 | @Scripts.Render("~/bundles/jqueryval") 42 | } 43 | -------------------------------------------------------------------------------- /Application.BoundedContext.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Application.BoundedContext.Tests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("General Electric")] 12 | [assembly: AssemblyProduct("Application.BoundedContext.Tests")] 13 | [assembly: AssemblyCopyright("Copyright © General Electric 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("507ad184-5ec1-443b-afd5-819982553b55")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Infrastructure.CrossCutting.IoC/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Infrastructure.CrossCutting.IoC")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("General Electric")] 12 | [assembly: AssemblyProduct("Infrastructure.CrossCutting.IoC")] 13 | [assembly: AssemblyCopyright("Copyright © General Electric 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("97a57f0c-2caa-4011-bc3c-be4ea94ba936")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Infrastructure.CrossCutting.Test/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Infrastructure.CrossCutting.Test")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("General Electric")] 12 | [assembly: AssemblyProduct("Infrastructure.CrossCutting.Test")] 13 | [assembly: AssemblyCopyright("Copyright © General Electric 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("57146cdc-740c-4101-9523-01f88b7e57e8")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Infrastructure.Data.BoundedContext")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("General Electric")] 12 | [assembly: AssemblyProduct("Infrastructure.Data.BoundedContext")] 13 | [assembly: AssemblyCopyright("Copyright © General Electric 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("7d8727d3-c74b-400b-8ea6-6ae380c15028")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Infrastructure.CrossCutting.SeedWork/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Infrastructure.CrossCutting.SeedWork")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("General Electric")] 12 | [assembly: AssemblyProduct("Infrastructure.CrossCutting.SeedWork")] 13 | [assembly: AssemblyCopyright("Copyright © General Electric 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("24d3c72f-72ca-4fed-b58f-ff5d5dd31e7c")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Infrastructure.CrossCutting.NetFramework/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Infrastructure.CrossCutting.NetFramework")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("General Electric")] 12 | [assembly: AssemblyProduct("Infrastructure.CrossCutting.NetFramework")] 13 | [assembly: AssemblyCopyright("Copyright © General Electric 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("004a6f37-4728-465f-b439-3361fea115bb")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext.Test/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Infrastructure.Data.BoundedContext.Test")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("General Electric")] 12 | [assembly: AssemblyProduct("Infrastructure.Data.BoundedContext.Test")] 13 | [assembly: AssemblyCopyright("Copyright © General Electric 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("3881bb75-8aa3-4cb0-aae4-062878275ab1")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Infrastructure.Data.BoundedContext.Tests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("General Electric")] 12 | [assembly: AssemblyProduct("Infrastructure.Data.BoundedContext.Tests")] 13 | [assembly: AssemblyCopyright("Copyright © General Electric 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("45351e54-6528-493e-b0d8-27c7d7bea1ed")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Domain.BoundedContext/ERPModule/Employee/Employee.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.ERPModule 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel.DataAnnotations; 6 | using Domain.Core; 7 | using System.ComponentModel.DataAnnotations.Schema; 8 | using Domain.BoundedContext.Resources; 9 | 10 | /// 11 | /// Aggregate root for Employee Aggregate. 12 | /// 13 | [Table("Employees")] 14 | public class Employee 15 | : Person 16 | { 17 | 18 | #region Properties 19 | 20 | /// 21 | /// Get or set the Date of Creation 22 | /// 23 | [DataType(DataType.DateTime)] 24 | public DateTime HireDate { get; set; } 25 | 26 | /// 27 | /// Get or set the Postion identifier 28 | /// 29 | public Guid PostionId { get; set; } 30 | 31 | /// 32 | /// Get or set the Postion 33 | /// 34 | [Required(ErrorMessageResourceName = "PositionRequired",ErrorMessageResourceType=typeof (Messages))] 35 | [ForeignKey("PostionId")] 36 | public Position Postion { get; set; } 37 | 38 | /// 39 | /// Get or set associated Department identifier 40 | /// 41 | public Guid DepartmentId { get; set; } 42 | 43 | /// 44 | /// Get the current Department for this employee 45 | /// 46 | [ForeignKey("DepartmentId")] 47 | public virtual Department Department { get; set; } 48 | 49 | #endregion 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Infrastructure.CrossCutting.IoC/IoCFactory.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace Infrastructure.CrossCutting.IoC 3 | { 4 | using System; 5 | using System.Collections.Generic; 6 | using Infrastructure.CrossCutting.Core; 7 | using Infrastructure.CrossCutting.IoC.Unity; 8 | 9 | /// 10 | /// IoCFactory implementation 11 | /// 12 | public sealed class IoCFactory 13 | { 14 | #region Singleton 15 | 16 | static readonly IoCFactory instance = new IoCFactory(); 17 | 18 | /// 19 | /// Get singleton instance of IoCFactory 20 | /// 21 | public static IoCFactory Instance 22 | { 23 | get 24 | { 25 | return instance; 26 | } 27 | } 28 | 29 | #endregion 30 | 31 | #region Members 32 | 33 | IContainer _CurrentContainer; 34 | 35 | /// 36 | /// Get current configured IContainer 37 | /// 38 | /// At this moment only IoCUnityContainer existss 39 | /// 40 | /// 41 | public IContainer CurrentContainer 42 | { 43 | get 44 | { 45 | return _CurrentContainer; 46 | } 47 | } 48 | 49 | #endregion 50 | 51 | #region Constructor 52 | 53 | /// 54 | /// Only for singleton pattern, remove before field init IL anotation 55 | /// 56 | static IoCFactory() { } 57 | IoCFactory() 58 | { 59 | _CurrentContainer = new IoCUnityContainer(); 60 | } 61 | 62 | #endregion 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | @ViewBag.Title - PolyGlot Persistence Demo 7 | @Styles.Render("~/Content/css") 8 | @Scripts.Render("~/bundles/modernizr") 9 | 10 | 11 | 12 | 31 |
32 | @RenderBody() 33 |
34 |
35 |

© @DateTime.Now.Year - Agility Labs Q1 2015

36 |
37 |
38 | 39 | @Scripts.Render("~/bundles/jquery") 40 | @Scripts.Render("~/bundles/bootstrap") 41 | @RenderSection("scripts", required: false) 42 | 43 | 44 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client.Cloud.Azure/ASP.NET.MVC5.Client.CloudContent/diagnostics.wadcfg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Facility/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET.MVC5.Client.Models.FacilityCreateViewModel 2 | @{ 3 | ViewBag.Title = "Create"; 4 | } 5 | 6 |

Create facility

7 | 8 | 9 | 10 | @using (Html.BeginForm("Create", "Facility", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 11 | { 12 | @Html.AntiForgeryToken() 13 | 14 |
15 | @Html.ValidationSummary("", new { @class = "text-danger" }) 16 |
17 | @Html.LabelFor(m => m.Name, new { @class = "col-md-2 control-label" }) 18 |
19 | @Html.TextBoxFor(m => m.Name, new { @class = "form-control" }) 20 |
21 |
22 |
23 | @Html.LabelFor(m => m.Address, new { @class = "col-md-2 control-label" }) 24 |
25 | @Html.TextBoxFor(m => m.Address, new { @class = "form-control" }) 26 |
27 |
28 |
29 | @Html.LabelFor(m => m.City, new { @class = "col-md-2 control-label" }) 30 |
31 | @Html.TextBoxFor(m => m.City, new { @class = "form-control" }) 32 |
33 |
34 |
35 | @Html.LabelFor(m => m.ZipCode, new { @class = "col-md-2 control-label" }) 36 |
37 | @Html.TextBoxFor(m => m.ZipCode, new { @class = "form-control" }) 38 |
39 |
40 |
41 |
42 | 43 |
44 |
45 | } -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Models/EquipmentViewModels.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Web; 6 | using System.Web.Mvc; 7 | 8 | namespace ASP.NET.MVC5.Client.Models 9 | { 10 | public class EquipmentViewModels 11 | { 12 | } 13 | public class EquipmentItemViewModel 14 | { 15 | public string Id { get; set; } 16 | public string DepartmentName { get; set; } 17 | public string Name { get; set; } 18 | public string EquipmentModel { get; set; } 19 | public string CreationDate { get; set; } 20 | public string Description { get; set; } 21 | } 22 | 23 | 24 | public class EquipmentListViewModel 25 | { 26 | public int Total { get; set; } 27 | public IEnumerable Equipment { get; set; } 28 | } 29 | 30 | public class EquipmentCreateViewModel 31 | { 32 | 33 | public string Id { get; set; } 34 | 35 | [Required] 36 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 37 | [Display(Name = "Equipment Name")] 38 | public string Name { get; set; } 39 | 40 | [Required] 41 | [Display(Name = "Model")] 42 | public string EquipmentModel { get; set; } 43 | 44 | [Required] 45 | [Display(Name = "Department Name")] 46 | public string DepartmentId { get; set; } 47 | public IEnumerable FacilitiesModel { get; set; } 48 | 49 | [Required] 50 | [Display(Name = "Description")] 51 | public string Description { get; set; } 52 | } 53 | 54 | 55 | 56 | } -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Models/AspnetIdentity/ApplicationUser.cs: -------------------------------------------------------------------------------- 1 | using Application.BoundedContext.MembershipModule; 2 | using Domain.Core; 3 | using Microsoft.AspNet.Identity; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Security.Claims; 8 | using System.Threading.Tasks; 9 | using System.Web; 10 | 11 | namespace ASP.NET.MVC5.Client.Models 12 | { 13 | public class ApplicationUser : IUser 14 | { 15 | public string Id { get; set; } 16 | 17 | public string UserName { get; set; } 18 | 19 | public string Email { get; set; } 20 | 21 | public string PasswordHash { get; set; } 22 | 23 | public string PhoneNumber { get; set; } 24 | 25 | public string SecurityStamp { get; set; } 26 | 27 | public bool LockoutEnabled { get; set; } 28 | 29 | public int AccessFailedCount { get; set; } 30 | 31 | public bool TwoFactorEnabled { get; set; } 32 | 33 | public DateTime? LockoutEndDateUtc { get; set; } 34 | 35 | public bool EmailConfirmed { get; set; } 36 | 37 | public bool PhoneNumberConfirmed { get; set; } 38 | 39 | 40 | public ApplicationUser() 41 | { 42 | this.Id = IdentityGenerator.SequentialGuid().ToString(); 43 | } 44 | public async Task GenerateUserIdentityAsync(ApplicationUserManager manager) 45 | { 46 | // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType 47 | var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie); 48 | // Add custom user claims here 49 | return userIdentity; 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /Infrastructure.Data.Core/InMemorySet/InMemoryDbAsyncEnumerable.cs: -------------------------------------------------------------------------------- 1 | // Decompiled with JetBrains decompiler 2 | // Type: Pedago.Infrastructure.Data.Core.InMemoryDbAsyncEnumerable`1 3 | // Assembly: Infrastructure.Data.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 4 | // MVID: 63C97C68-8138-419C-94E3-46CB97551F41 5 | // Assembly location: C:\Pedago\Solution1\ASP.NET.MVC5.Client\bin\Infrastructure.Data.Core.dll 6 | 7 | using System.Collections; 8 | using System.Collections.Generic; 9 | using System.Data.Entity.Infrastructure; 10 | using System.Linq; 11 | using System.Linq.Expressions; 12 | 13 | namespace Infrastructure.Data.Core 14 | { 15 | public class InMemoryDbAsyncEnumerable : EnumerableQuery, IDbAsyncEnumerable, IDbAsyncEnumerable, IQueryable, IEnumerable, IQueryable, IEnumerable 16 | { 17 | IQueryProvider IQueryable.Provider 18 | { 19 | get 20 | { 21 | return (IQueryProvider)new InMemoryDbAsyncQueryProvider((IQueryProvider)this); 22 | } 23 | } 24 | 25 | public InMemoryDbAsyncEnumerable(IEnumerable enumerable) 26 | : base(enumerable) 27 | { 28 | } 29 | 30 | public InMemoryDbAsyncEnumerable(Expression expression) 31 | : base(expression) 32 | { 33 | } 34 | 35 | public IDbAsyncEnumerator GetAsyncEnumerator() 36 | { 37 | return (IDbAsyncEnumerator)new InMemoryDbAsyncEnumerator(Enumerable.AsEnumerable((IEnumerable)this).GetEnumerator()); 38 | } 39 | 40 | IDbAsyncEnumerator IDbAsyncEnumerable.GetAsyncEnumerator() 41 | { 42 | return (IDbAsyncEnumerator)this.GetAsyncEnumerator(); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Infrastructure.Data.Core/InMemorySet/InMemoryDbAsyncQueryProvider.cs: -------------------------------------------------------------------------------- 1 | namespace Infrastructure.Data.Core 2 | { 3 | using System.Data.Entity.Infrastructure; 4 | using System.Linq; 5 | using System.Linq.Expressions; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | public class InMemoryDbAsyncQueryProvider : IDbAsyncQueryProvider, IQueryProvider 9 | { 10 | private readonly IQueryProvider _inner; 11 | 12 | internal InMemoryDbAsyncQueryProvider(IQueryProvider inner) 13 | { 14 | this._inner = inner; 15 | } 16 | 17 | public IQueryable CreateQuery(Expression expression) 18 | { 19 | return (IQueryable)new InMemoryDbAsyncEnumerable(expression); 20 | } 21 | 22 | public IQueryable CreateQuery(Expression expression) 23 | { 24 | return (IQueryable)new InMemoryDbAsyncEnumerable(expression); 25 | } 26 | 27 | public object Execute(Expression expression) 28 | { 29 | return this._inner.Execute(expression); 30 | } 31 | 32 | public TResult Execute(Expression expression) 33 | { 34 | return this._inner.Execute(expression); 35 | } 36 | 37 | public Task ExecuteAsync(Expression expression, CancellationToken cancellationToken) 38 | { 39 | return Task.FromResult(this.Execute(expression)); 40 | } 41 | 42 | public Task ExecuteAsync(Expression expression, CancellationToken cancellationToken) 43 | { 44 | return Task.FromResult(this.Execute(expression)); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Equipment/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET.MVC5.Client.Models.EquipmentCreateViewModel 2 | @{ 3 | ViewBag.Title = "Create"; 4 | } 5 | 6 |

Create equipment

7 | 8 | 9 | 10 | @using (Html.BeginForm("Create", "Equipment", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) 11 | { 12 | @Html.AntiForgeryToken() 13 | 14 |
15 | @Html.ValidationSummary("", new { @class = "text-danger" }) 16 |
17 | @Html.LabelFor(m => m.Name, new { @class = "col-md-2 control-label" }) 18 |
19 | @Html.TextBoxFor(m => m.Name, new { @class = "form-control" }) 20 |
21 |
22 |
23 | @Html.LabelFor(m => m.EquipmentModel, new { @class = "col-md-2 control-label" }) 24 |
25 | @Html.TextBoxFor(m => m.EquipmentModel, new { @class = "form-control" }) 26 |
27 |
28 |
29 | @Html.LabelFor(m => m.DepartmentId, new { @class = "col-md-2 control-label" }) 30 |
31 | @Html.DropDownListFor(m => m.DepartmentId, Model.FacilitiesModel, new { @class = "form-control" }) 32 |
33 |
34 |
35 | @Html.LabelFor(m => m.Description, new { @class = "col-md-2 control-label" }) 36 |
37 | @Html.TextAreaFor(m => m.Description, new { @class = "form-control" }) 38 |
39 |
40 |
41 |
42 | 43 |
44 |
45 | } -------------------------------------------------------------------------------- /Domain.BoundedContext/ERPModule/Department/Department.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.ERPModule 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel.DataAnnotations; 6 | using Domain.Core; 7 | using System.ComponentModel.DataAnnotations.Schema; 8 | using Domain.BoundedContext.Resources; 9 | 10 | /// 11 | /// Aggregate root for Department Aggregate. 12 | /// 13 | [Table("Departments")] 14 | public class Department 15 | : EntityBase 16 | { 17 | 18 | #region Properties 19 | 20 | /// 21 | /// Get or set the Given name of this customer 22 | /// 23 | [Required(ErrorMessageResourceName = "DepartmentNameRequired", ErrorMessageResourceType = typeof(Messages))] 24 | [MaxLength(50, ErrorMessageResourceName = "DepartmentNameMaxLength", ErrorMessageResourceType = typeof(Messages))] 25 | public string Name { get; set; } 26 | 27 | /// 28 | /// Get or set associated Organization identifier 29 | /// 30 | public Guid OrganizationId { get; set; } 31 | 32 | /// 33 | /// Get the current Organization 34 | /// 35 | [ForeignKey("OrganizationId")] 36 | public virtual Organization Organization { get; set; } 37 | 38 | /// 39 | /// Get or set the Employees list 40 | /// 41 | public virtual ICollection Employees { get; set; } 42 | 43 | /// 44 | /// Get or set the Position list 45 | /// 46 | public virtual ICollection Positions { get; set; } 47 | 48 | #endregion 49 | 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/App_Start/BootStrapper.cs: -------------------------------------------------------------------------------- 1 | using ASP.NET.MVC5.Client.Models; 2 | using Infrastructure.CrossCutting.Core; 3 | using Infrastructure.CrossCutting.IoC; 4 | using Microsoft.Owin.Security; 5 | using Pedago.ASP.NET.MVC5.Client.Extension; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Linq; 9 | using System.Reflection; 10 | using System.Web; 11 | using System.Web.Mvc; 12 | 13 | 14 | [assembly: PreApplicationStartMethod(typeof(ASP.NET.MVC5.Client.BootStrapper), "Start")] 15 | 16 | namespace ASP.NET.MVC5.Client 17 | { 18 | public static class BootStrapper 19 | { 20 | public static void Start() 21 | { 22 | IoCFactory.Instance.CurrentContainer.RegisterInstance(); 23 | IoCFactory.Instance.CurrentContainer.RegisterType(typeof(ApplicationUserManager)); 24 | IoCFactory.Instance.CurrentContainer.RegisterType(typeof(ApplicationSignInManager)); 25 | IoCFactory.Instance.CurrentContainer.RegisterType(typeof(EmailManagementServices)); 26 | IoCFactory.Instance.CurrentContainer.RegisterInstance(c => HttpContext.Current.GetOwinContext().Authentication); 27 | DependencyResolver.SetResolver((IDependencyResolver)new UnityWebResolver(IoCFactory.Instance.CurrentContainer)); 28 | } 29 | 30 | public static void Stop() 31 | { 32 | } 33 | 34 | private static void RegisterControllers(IContainer _currentContainer) 35 | { 36 | IEnumerable controllerTypes = Assembly.GetExecutingAssembly().GetExportedTypes().Where(x => typeof(IController).IsAssignableFrom(x)); 37 | foreach (Type type in controllerTypes) 38 | { 39 | _currentContainer.RegisterType(type); 40 | } 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /Infrastructure.CrossCutting.SeedWork/Logging/ILogger.cs: -------------------------------------------------------------------------------- 1 | namespace Infrastructure.CrossCutting.Core 2 | { 3 | /// 4 | /// Trace manager contract for trace instrumentation 5 | /// 6 | public interface ILogger 7 | { 8 | /// 9 | /// Start logical operation in trace repository 10 | /// 11 | /// 12 | void TraceStartLogicalOperation(string operationName); 13 | 14 | /// 15 | /// Stop actual logical operation in trace repository 16 | /// 17 | void TraceStopLogicalOperation(); 18 | 19 | /// 20 | /// Send "start" flag to trace repository 21 | /// 22 | void TraceStart(); 23 | 24 | /// 25 | /// Send "stop" flag to trace repository 26 | /// 27 | void TraceStop(); 28 | 29 | /// 30 | /// Trace information message to trace repository 31 | /// Information message to trace 32 | /// 33 | void TraceInfo(string message); 34 | 35 | /// 36 | /// Trace warning message to trace repository 37 | /// 38 | /// Warning message to trace 39 | void TraceWarning(string message); 40 | 41 | /// 42 | /// Trace error message to trace repository 43 | /// 44 | /// Error message to trace 45 | void TraceError(string message); 46 | 47 | /// 48 | /// Trace critical message to trace repository 49 | /// 50 | /// Critical message to trace 51 | void TraceCritical(string message); 52 | } 53 | } 54 | 55 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client.Tests/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Application.BoundedContext/ERPModule/OrganizationManagementService.cs: -------------------------------------------------------------------------------- 1 | using Domain.BoundedContext.ERPModule; 2 | using Infrastructure.CrossCutting.Core; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading; 8 | using System.Threading.Tasks; 9 | 10 | namespace Application.BoundedConext.ERPModule 11 | { 12 | public class OrganizationManagementService : IOrganizationManagementService 13 | { 14 | private IOrganizationRepository _organizationRepository; 15 | private ILogger _logger; 16 | 17 | public OrganizationManagementService(IOrganizationRepository organizationRepository, ILogger logger) 18 | { 19 | if (organizationRepository == (IOrganizationRepository)null) 20 | throw new ArgumentNullException("organizationRepository"); 21 | if (logger == (ILogger)null) 22 | throw new ArgumentNullException("logger"); 23 | this._organizationRepository = organizationRepository; 24 | this._logger = logger; 25 | } 26 | 27 | 28 | public Task AddAsync(Organization organization, CancellationToken cancellationToken = default(CancellationToken)) 29 | { 30 | cancellationToken.ThrowIfCancellationRequested(); 31 | if (organization == (Organization)null) 32 | throw new ArgumentNullException("organization"); 33 | 34 | 35 | this._organizationRepository.Add(organization); 36 | return this._organizationRepository.UnitOfWork.CommitAsync(cancellationToken); 37 | } 38 | 39 | public Task> GetAllFacilitiesAsync(CancellationToken cancellationToken = default(CancellationToken)) 40 | { 41 | return Task.FromResult>(this._organizationRepository.GetAllElements()); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Domain.BoundedContext/ERPModule/Organization/Organization.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.ERPModule 2 | { 3 | using Domain.BoundedContext.Resources; 4 | using Domain.Core; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.ComponentModel.DataAnnotations; 8 | using System.ComponentModel.DataAnnotations.Schema; 9 | 10 | /// 11 | /// Aggregate root for Organization Aggregate. 12 | /// 13 | [Table("Organizations")] 14 | public class Organization 15 | : EntityBase 16 | { 17 | 18 | #region Properties 19 | 20 | 21 | /// 22 | /// Get or set the Given name of this customer 23 | /// 24 | [Required(ErrorMessageResourceName = "OrganizationNameRequired", ErrorMessageResourceType = typeof(Messages))] 25 | [MaxLength(50, ErrorMessageResourceName = "OrganizationNameMaxLength", ErrorMessageResourceType = typeof(Messages))] 26 | public string Name { get; set; } 27 | 28 | /// 29 | /// Get or set the Address identifier 30 | /// 31 | public Guid AddressId { get; set; } 32 | 33 | /// 34 | /// Get or set the address 35 | /// 36 | [ForeignKey("AddressId")] 37 | public virtual Address Address { get; set; } 38 | 39 | /// 40 | /// Get or set associated Customer identifier 41 | /// 42 | public Guid CustomerId { get; set; } 43 | 44 | /// 45 | /// Get the current Customer 46 | /// 47 | [ForeignKey("CustomerId")] 48 | public virtual Customer Customer { get; set; } 49 | 50 | /// 51 | /// Get or set the Departments list 52 | /// 53 | public virtual ICollection Departments { get; set; } 54 | 55 | #endregion 56 | 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /PolyGlotPersitence.Modeling/UMLClassDiagram2.classdiagram: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Home Page"; 3 | } 4 | 5 |
6 |

PolyGlot Persistence Demo

7 |

Investigate on how the data access layer that can use several types of data-stores depending on the information, in a way that is transparent to the application

8 |
9 | 10 |
11 |
12 |

Facilities In SQL server data store

13 |

14 | in Facilities we store not huge amount of a data and it does not change frequentrly ,but we need security and normalized data 15 |

16 |

17 | @Html.ActionLink("View", "index", "Facility", null, new { @class = "btn btn-primary btn-lg " }) 18 |

19 |
20 |
21 |

Equipemnt in Lucene data store

22 |

there is huge amount of data accessed in different mode read write update , search and stats (more selective and needs to filter records based on non-key fields)

23 |

24 | @Html.ActionLink("View", "index", "Equipment", null, new { @class = "btn btn-primary btn-lg " }) 25 |

26 |
27 |
28 |

Departments in Mongo Data store

29 |

not huge amount of data the add/update opeartions are less frequent oposit of the read operations that are very frequents(more selective and needs to filter records based on non-key fields)

30 |

31 | @Html.ActionLink("View", "index", "Department",null, new { @class = "btn btn-primary btn-lg " }) 32 |

33 |
34 |
35 |

Audit trial in azure table key value store

36 |

Huge amount of data used only for data manupulatin.opaque data items .

37 |

View »

38 |
39 |
40 | -------------------------------------------------------------------------------- /Infrastructure.Data.Core/ISql.cs: -------------------------------------------------------------------------------- 1 | //=================================================================================== 2 | // 3 | //=================================================================================== 4 | // 5 | // 6 | // 7 | //=================================================================================== 8 | // 9 | // 10 | // 11 | //=================================================================================== 12 | 13 | 14 | namespace Infrastructure.Data.Core 15 | { 16 | using System; 17 | using System.Collections.Generic; 18 | using System.Linq; 19 | using System.Text; 20 | 21 | 22 | /// 23 | /// Base contract for support 'dialect specific queries'. 24 | /// 25 | public interface ISql 26 | { 27 | /// 28 | /// Execute specific query with underliying persistence store 29 | /// 30 | /// Entity type to map query results 31 | /// 32 | /// Dialect Query 33 | /// 34 | /// SELECT idCustomer,Name FROM dbo.[Customers] WHERE idCustomer > {0} 35 | /// 36 | /// 37 | /// A vector of parameters values 38 | /// 39 | /// Enumerable results 40 | /// 41 | IEnumerable ExecuteQuery(string sqlQuery, params object[] parameters); 42 | 43 | /// 44 | /// Execute arbitrary command into underliying persistence store 45 | /// 46 | /// 47 | /// Command to execute 48 | /// 49 | /// SELECT idCustomer,Name FROM dbo.[Customers] WHERE idCustomer > {0} 50 | /// 51 | /// 52 | /// A vector of parameters values 53 | /// The number of affected records 54 | int ExecuteCommand(string sqlCommand, params object[] parameters); 55 | 56 | 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client.Tests/CodedUITests/BrowserSelect/BrowserSelect.cs: -------------------------------------------------------------------------------- 1 | using OpenQA.Selenium; 2 | using OpenQA.Selenium.Chrome; 3 | using OpenQA.Selenium.Firefox; 4 | using OpenQA.Selenium.IE; 5 | using System; 6 | using System.Configuration; 7 | using System.IO; 8 | using System.Reflection; 9 | 10 | namespace ASP.NET.MVC5.Client.Tests.CodedUITests 11 | { 12 | public static class BrowserSelect 13 | { 14 | public static IWebDriver GetConfigBrowser(string browserName) 15 | { 16 | string AppRoot = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 17 | string strDriverPath = null; 18 | IWebDriver webDriver = null; 19 | if (browserName.Equals("Firefox", StringComparison.InvariantCultureIgnoreCase)) 20 | { 21 | webDriver = new FirefoxDriver(); 22 | } 23 | else if (browserName.Equals("chrome", StringComparison.InvariantCultureIgnoreCase)) 24 | { 25 | strDriverPath = Path.Combine(AppRoot, @"CodedUITests\Drivers\chromedriver_win32"); 26 | webDriver = new ChromeDriver(strDriverPath); 27 | 28 | } 29 | else if (browserName.Equals("IE", StringComparison.InvariantCultureIgnoreCase)) 30 | { 31 | InternetExplorerOptions options = new InternetExplorerOptions() 32 | { 33 | EnableNativeEvents = true, 34 | IgnoreZoomLevel = true 35 | }; 36 | strDriverPath = Path.Combine(AppRoot, @"CodedUITests\Drivers\IEDriverServer_Win32_2.44.0"); 37 | webDriver = new InternetExplorerDriver(strDriverPath, options, TimeSpan.FromMinutes(3.0)); 38 | } 39 | if (webDriver == null) 40 | throw new Exception("must configure browsername in aap.config"); 41 | else 42 | return webDriver; 43 | } 44 | 45 | public static IWebDriver GetConfigBrowser() 46 | { 47 | return BrowserSelect.GetConfigBrowser(ConfigurationManager.AppSettings["browserName"]); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Application.BoundedContext/Blob/BlobManagementServices.cs: -------------------------------------------------------------------------------- 1 | namespace Application.BoundedConext.Blob 2 | { 3 | using System.Threading.Tasks; 4 | using Domain.BoundedContext.BlobAggregates; 5 | using Infrastructure.CrossCutting.Core; 6 | using System; 7 | using Infrastructure.Data.BoundedContext.UnitOfWork; 8 | using System.Collections.Generic; 9 | 10 | public class BlobManagementServices:IBlobManagementServices 11 | { 12 | 13 | 14 | #region Fields 15 | private IBlobAggregateRepository _blobRepository; 16 | private ILogger _logger; 17 | #endregion 18 | 19 | #region Ctor 20 | public BlobManagementServices(IBlobAggregateRepository blobRepository, ILogger logger) 21 | { 22 | if (blobRepository == (IBlobAggregateRepository)null) 23 | throw new ArgumentNullException("blobRepository"); 24 | if (logger == (ILogger)null) 25 | throw new ArgumentNullException("logger"); 26 | this._blobRepository = blobRepository; 27 | this._logger = logger; 28 | } 29 | 30 | #endregion 31 | 32 | 33 | 34 | #region IBlobManagementServices 35 | 36 | /// 37 | /// 38 | /// 39 | /// 40 | public Task UploadBlobAsync(BlobAggregate file) 41 | { 42 | 43 | this._blobRepository.Add(file); 44 | 45 | return this._blobRepository.UnitOfWork.CommitAsync(); 46 | } 47 | 48 | /// 49 | /// 50 | /// 51 | /// 52 | public Task UploadBlobAsync(IEnumerable files) 53 | { 54 | foreach (var file in files) 55 | { 56 | this._blobRepository.Add(file); 57 | } 58 | 59 | return this._blobRepository.UnitOfWork.CommitAsync(); 60 | } 61 | 62 | 63 | 64 | #endregion 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Infrastructure.CrossCutting.SeedWork/IoC/IContainer.cs: -------------------------------------------------------------------------------- 1 | namespace Infrastructure.CrossCutting.Core 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | 6 | /// 7 | /// Base contract for locator and register dependencies 8 | /// 9 | public interface IContainer : IDisposable 10 | { 11 | /// 12 | /// Solve TService dependency 13 | /// 14 | /// Type of dependency 15 | /// instance of TService 16 | TService Resolve(); 17 | 18 | /// 19 | /// Solve type construction and return the object as a TService instance 20 | /// 21 | /// instance of this type 22 | object Resolve(Type type); 23 | 24 | /// 25 | /// Register type into service locator 26 | /// 27 | /// Type to register 28 | void RegisterType(Type type); 29 | 30 | /// 31 | /// Solve type construction and return the list of resolved objects 32 | /// 33 | /// instance of this type 34 | IEnumerable ResolveAll(Type type); 35 | 36 | /// 37 | /// create a new child container 38 | /// 39 | /// child as instance of IContainer 40 | IContainer CreateChildContainer(); 41 | 42 | /// 43 | /// register a type with specific member 44 | /// 45 | /// type interface 46 | /// instance member 47 | void RegisterInstance(Func instance); 48 | 49 | /// 50 | /// Regiter a type mmappin with a given container 51 | /// 52 | /// type interface 53 | /// type instance 54 | void RegisterInstance() where TTo : TFrom; 55 | 56 | } 57 | } 58 | 59 | -------------------------------------------------------------------------------- /Application.BoundedContext.Tests/Initializer/AssemblyTestsInitializerAzure.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | using System.Diagnostics; 3 | using System.Linq; 4 | 5 | namespace Application.BoundedConext.Tests 6 | { 7 | [TestClass] 8 | public class AssemblyTestsInitialize 9 | { 10 | private const string _windowsAzureStorageEmulatorPath = @"C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\WAStorageEmulator.exe"; 11 | private const string _win7ProcessName = "WAStorageEmulator"; 12 | private const string _win8ProcessName = "WASTOR~1"; 13 | private static readonly ProcessStartInfo startStorageEmulator = new ProcessStartInfo 14 | { 15 | FileName = _windowsAzureStorageEmulatorPath, 16 | Arguments = "start", 17 | }; 18 | 19 | private static readonly ProcessStartInfo stopStorageEmulator = new ProcessStartInfo 20 | { 21 | FileName = _windowsAzureStorageEmulatorPath, 22 | Arguments = "stop", 23 | }; 24 | 25 | [AssemblyInitialize] 26 | public static void LaunchEmulator(TestContext context) 27 | { 28 | StartStorageEmulator(); 29 | } 30 | 31 | 32 | private static Process GetProcess() 33 | { 34 | return Process.GetProcessesByName(_win7ProcessName).FirstOrDefault() ?? Process.GetProcessesByName(_win8ProcessName).FirstOrDefault(); 35 | } 36 | 37 | private static bool IsProcessStarted() 38 | { 39 | return GetProcess() != null; 40 | } 41 | 42 | private static void StartStorageEmulator() 43 | { 44 | if (!IsProcessStarted()) 45 | { 46 | using (Process process = Process.Start(startStorageEmulator)) 47 | { 48 | process.WaitForExit(); 49 | } 50 | } 51 | } 52 | 53 | 54 | private static void StopStorageEmulator() 55 | { 56 | using (Process process = Process.Start(stopStorageEmulator)) 57 | { 58 | process.WaitForExit(); 59 | } 60 | } 61 | 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Domain.Core/IUnitOfWork.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.Core 2 | { 3 | using System; 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | 7 | /// 8 | /// Contract for ‘UnitOfWork pattern’. For more 9 | /// This interface/contract should be complied by any UoW implementation to be used with this Domain. 10 | /// 11 | public interface IUnitOfWork 12 | : IDisposable 13 | { 14 | /// 15 | /// Commit all changes made in a container. 16 | /// 17 | /// 18 | /// If the entity have fixed properties and any optimistic concurrency problem exists, 19 | /// then an exception is thrown 20 | /// 21 | void Commit(); 22 | 23 | /// 24 | /// Commit all changes made in a container. 25 | /// 26 | /// 27 | /// If the entity have fixed properties and any optimistic concurrency problem exists, 28 | /// then 'client changes' are refreshed - Client wins 29 | /// 30 | void CommitAndRefreshChanges(); 31 | 32 | /// 33 | /// Rollback changes are not stored in the database at 34 | /// this moment. See references of UnitOfWork pattern 35 | /// 36 | void RollbackChanges(); 37 | 38 | /// 39 | /// Commit all changes made in a container Async. 40 | /// 41 | /// 42 | /// If the entity have fixed properties and any optimistic concurrency problem exists, 43 | /// then an exception is thrown 44 | /// 45 | Task CommitAsync( CancellationToken cancellationToken = default(CancellationToken)); 46 | 47 | /// 48 | /// Commit all changes made in a container Async. 49 | /// 50 | /// 51 | /// If the entity have fixed properties and any optimistic concurrency problem exists, 52 | /// then 'client changes' are refreshed - Client wins 53 | /// 54 | Task CommitAndRefreshChangesAsync(CancellationToken cancellationToken = default(CancellationToken)); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext.Test/Repositories/OrganizationRepositoryTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | using Domain.BoundedContext.ERPModule; 4 | using Infrastructure.CrossCutting.IoC; 5 | using System.Linq; 6 | 7 | namespace Infrastructure.Data.BoundedContext.Tests.Repositories 8 | { 9 | [TestClass] 10 | public class OrganizationRepositoryTests 11 | { 12 | [TestMethod] 13 | public void OrganizationRepository_GetByIdValidIdTest() 14 | { 15 | Guid id = new Guid("32f6c66a-d762-c890-3b5a-08d1ffaa17c7"); 16 | IOrganizationRepository repo = IoCFactory.Instance.CurrentContainer.Resolve(); 17 | Organization org= repo.GetElementById(id); 18 | Assert.IsNotNull((object)org); 19 | Assert.IsTrue(org.Id == id); 20 | } 21 | 22 | [TestMethod] 23 | public void OrganizationRepository_GetAllTest() 24 | { 25 | IOrganizationRepository repo = IoCFactory.Instance.CurrentContainer.Resolve(); 26 | IQueryable all = repo.GetAllElements(); 27 | Assert.IsNotNull(all); 28 | Assert.IsTrue( all.Count() > 0); 29 | } 30 | 31 | [TestMethod] 32 | public void UserRepository_AddTest_ValidUser_NewAddress() 33 | { 34 | IOrganizationRepository repo = IoCFactory.Instance.CurrentContainer.Resolve(); 35 | Organization org = new Organization() 36 | { 37 | Id = new Guid("514c5873-bee8-cc78-3de8-08d1b9e806d0"), 38 | Name = "test2.test@test2.test", 39 | Address = new Address() 40 | { 41 | Id = Guid.NewGuid(), 42 | AddressLine1 = "test2", 43 | ZipCode = "12352", 44 | City = "Test2" 45 | } 46 | }; 47 | 48 | repo.Add(org); 49 | repo.UnitOfWork.Commit(); 50 | Organization byId = repo.GetElementById(org.Id); 51 | Assert.IsNotNull(byId); 52 | Assert.IsTrue(byId.Id == org.Id); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client/Views/Manage/ManageLogins.cshtml: -------------------------------------------------------------------------------- 1 | @model ASP.NET.MVC5.Client.Models.ManageLoginsViewModel 2 | @using Microsoft.Owin.Security 3 | @{ 4 | ViewBag.Title = "Manage your external logins"; 5 | } 6 | 7 |

@ViewBag.Title.

8 | 9 |

@ViewBag.StatusMessage

10 | @if (Model.CurrentLogins.Count > 0) 11 | { 12 |

Registered Logins

13 | 14 | 15 | @foreach (var account in Model.CurrentLogins) 16 | { 17 | 18 | 19 | 37 | 38 | } 39 | 40 |
@account.LoginProvider 20 | @if (ViewBag.ShowRemoveButton) 21 | { 22 | using (Html.BeginForm("RemoveLogin", "Manage")) 23 | { 24 | @Html.AntiForgeryToken() 25 |
26 | @Html.Hidden("loginProvider", account.LoginProvider) 27 | @Html.Hidden("providerKey", account.ProviderKey) 28 | 29 |
30 | } 31 | } 32 | else 33 | { 34 | @:   35 | } 36 |
41 | } 42 | @if (Model.OtherLogins.Count > 0) 43 | { 44 |

Add another service to log in.

45 |
46 | using (Html.BeginForm("LinkLogin", "Manage")) 47 | { 48 | @Html.AntiForgeryToken() 49 |
50 |

51 | @foreach (AuthenticationDescription p in Model.OtherLogins) 52 | { 53 | 54 | } 55 |

56 |
57 | } 58 | } 59 | 60 | -------------------------------------------------------------------------------- /Domain.BoundedContext/ERPModule/Customer/Customer.cs: -------------------------------------------------------------------------------- 1 | namespace Domain.BoundedContext.ERPModule 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel.DataAnnotations; 6 | using Domain.Core; 7 | using System.ComponentModel.DataAnnotations.Schema; 8 | using Domain.BoundedContext.Resources; 9 | 10 | /// 11 | /// Aggregate root for Customer Aggregate. 12 | /// 13 | [Table("Customers")] 14 | public class Customer 15 | : EntityBase 16 | { 17 | 18 | 19 | #region Properties 20 | 21 | /// 22 | /// Get or set the Given name of this customer 23 | /// 24 | [Required(ErrorMessageResourceName = "CustomerNameRequired", ErrorMessageResourceType = typeof(Messages))] 25 | public string Name { get; set; } 26 | 27 | /// 28 | /// Get or set the Given name of this customer 29 | /// 30 | public byte[] Logo { get; set; } 31 | /// 32 | /// Get or set the telephone 33 | /// 34 | [DataType(DataType.PhoneNumber, ErrorMessageResourceName = "InvalidPhoneNumber", ErrorMessageResourceType = typeof(Messages))] 35 | public string Phone { get; set; } 36 | 37 | /// 38 | /// Get or set the Email 39 | /// 40 | [DataType(DataType.EmailAddress, ErrorMessageResourceName = "EmailRequired", ErrorMessageResourceType = typeof(Messages))] 41 | public string Email { get; set; } 42 | 43 | /// 44 | /// Get or set if this customer is enabled 45 | /// 46 | public bool IsActive { get; set; } 47 | 48 | /// 49 | /// Get or set if this associated address identifier 50 | /// 51 | 52 | public Guid AddressId { get; set; } 53 | 54 | /// 55 | /// Get or set the address of this customer 56 | /// 57 | [ForeignKey("AddressId")] 58 | public virtual Address Address { get; set; } 59 | 60 | /// 61 | /// Get or set the Organization list 62 | /// 63 | public virtual ICollection Organizations { get; set; } 64 | 65 | #endregion 66 | 67 | 68 | 69 | 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Infrastructure.Data.Core/IQueryableUnitOfWork.cs: -------------------------------------------------------------------------------- 1 | //=================================================================================== 2 | // 3 | //=================================================================================== 4 | // 5 | // 6 | // 7 | //=================================================================================== 8 | // 9 | // 10 | // 11 | //=================================================================================== 12 | 13 | 14 | 15 | namespace Infrastructure.Data.Core 16 | { 17 | using System.Data.Entity; 18 | using Domain.Core; 19 | using System.Linq; 20 | 21 | /// 22 | /// The UnitOfWork contract for EF implementation 23 | /// 24 | /// This contract extend IUnitOfWork for use with EF code 25 | /// 26 | /// 27 | public interface IQueryableUnitOfWork 28 | : IUnitOfWork, ISql 29 | { 30 | /// 31 | /// Returns a IDbSet instance for access to entities of the given type in the context, 32 | /// the ObjectStateManager, and the underlying store. 33 | /// 34 | /// 35 | /// 36 | IQueryable CreateSet() where TEntity : class,new(); 37 | 38 | /// 39 | /// Attach this item into "ObjectStateManager" 40 | /// 41 | /// The type of entity 42 | /// The item < 43 | void Attach(TEntity item) where TEntity : class; 44 | 45 | /// 46 | /// Set object as modified 47 | /// 48 | /// The type of entity 49 | /// The entity item to set as modifed 50 | void SetModified(TEntity item) where TEntity : class; 51 | 52 | /// 53 | /// Apply current values in 54 | /// 55 | /// The type of entity 56 | /// The original entity 57 | /// The current entity 58 | void ApplyCurrentValues(TEntity original, TEntity current) where TEntity : class; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext.Test/Repositories/EquipmentAggregateRepositotyTests.cs: -------------------------------------------------------------------------------- 1 | using Domain.BoundedContext.StoreModule; 2 | using Infrastructure.CrossCutting.IoC; 3 | using Microsoft.VisualStudio.TestTools.UnitTesting; 4 | using System; 5 | using System.Linq; 6 | 7 | namespace Infrastructure.Data.BoundedContext.tests.Membership 8 | { 9 | [TestClass] 10 | public class EquipmentAggregateRepositotyTests 11 | { 12 | [TestMethod] 13 | public void EquipmentAggregateRepositoty_GetByIdValidIdTest() 14 | { 15 | Guid guid = new Guid("602D9F0C-40DA-4FCE-8C4D-F22748D5FB2D"); 16 | IEquipmentAggregateRepository repo = IoCFactory.Instance.CurrentContainer.Resolve(); 17 | EquipmentAggregate equipment= repo.GetElementById(guid); 18 | Assert.IsNotNull(equipment); 19 | Assert.IsTrue(equipment.Id == guid); 20 | } 21 | 22 | 23 | [TestMethod] 24 | public void EquipmentAggregateRepositoty_GetAllTest() 25 | { 26 | IQueryable all = IoCFactory.Instance.CurrentContainer.Resolve().GetAllElements(); 27 | Assert.IsNotNull(all); 28 | Assert.IsTrue(all.Any()); 29 | } 30 | 31 | [TestMethod] 32 | public void EquipmentAggregateRepositoty_AddTest() 33 | { 34 | IEquipmentAggregateRepository repo = IoCFactory.Instance.CurrentContainer.Resolve(); 35 | EquipmentAggregate equipment = new EquipmentAggregate() 36 | { 37 | Id = Guid.NewGuid(), 38 | DepartmentId = Guid.NewGuid(), 39 | DepartmentName="test facility", 40 | Model = "Type of equipment", 41 | Name = "test equipment" 42 | }; 43 | repo.Add(equipment); 44 | repo.UnitOfWork.Commit(); 45 | var all = repo.GetAllElements(); 46 | Assert.IsNotNull(all); 47 | Assert.IsTrue(all.Count()>1); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Application.BoundedContext/StoreModule/EquipmentAggregateManagementService.cs: -------------------------------------------------------------------------------- 1 | namespace Application.BoundedConext.StoreModule 2 | { 3 | using Domain.BoundedContext.StoreModule; 4 | using Infrastructure.CrossCutting.Core; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Threading; 8 | using System.Threading.Tasks; 9 | public class EquipmentAggregateManagementService : IEquipmentAggregateManagementService 10 | { 11 | 12 | private IEquipmentAggregateRepository _equipmentAggregateRepository; 13 | private ILogger _logger; 14 | 15 | public EquipmentAggregateManagementService(IEquipmentAggregateRepository equipmentAggregateRepository, ILogger logger) 16 | { 17 | if (equipmentAggregateRepository == (IEquipmentAggregateRepository)null) 18 | throw new ArgumentNullException("equipmentAggregateRepository"); 19 | if (logger == (ILogger)null) 20 | throw new ArgumentNullException("logger"); 21 | this._equipmentAggregateRepository = equipmentAggregateRepository; 22 | this._logger = logger; 23 | } 24 | 25 | /// 26 | /// 27 | /// 28 | /// 29 | /// 30 | /// 31 | public Task AddEquipmentAsync(EquipmentAggregate equipmentAggregate, CancellationToken cancellationToken = default(CancellationToken)) 32 | { 33 | cancellationToken.ThrowIfCancellationRequested(); 34 | if (equipmentAggregate == (EquipmentAggregate)null) 35 | throw new ArgumentNullException("equipmentAggregate"); 36 | _equipmentAggregateRepository.Add(equipmentAggregate); 37 | return Task.Run(() => 38 | { 39 | _equipmentAggregateRepository.UnitOfWork.Commit(); 40 | }); 41 | 42 | } 43 | 44 | /// 45 | /// 46 | /// 47 | /// 48 | /// 49 | public Task> GetAllEquipmentAsync(CancellationToken cancellationToken = default(CancellationToken)) 50 | { 51 | return Task.FromResult>(this._equipmentAggregateRepository.GetAllElements()); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Application.Core/Application.Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {CEEE0E39-E857-48E9-9008-732A8F7AEB4A} 8 | Library 9 | Properties 10 | Application.Core 11 | Application.Core 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 52 | -------------------------------------------------------------------------------- /Application.BoundedContext/ERPModule/DepartmentAggregateManagementService.cs: -------------------------------------------------------------------------------- 1 | using Domain.BoundedContext.ERPModule; 2 | using Infrastructure.CrossCutting.Core; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading; 8 | using System.Threading.Tasks; 9 | 10 | namespace Application.BoundedConext.ERPModule 11 | { 12 | public class DepartmentAggregateManagementService : IDepartmentAggregateManagementService 13 | { 14 | 15 | #region Ctor 16 | 17 | private IDepartmentAggregateRepository _departmentAggregateRepository; 18 | private ILogger _logger; 19 | 20 | public DepartmentAggregateManagementService(IDepartmentAggregateRepository departmentAggregateRepository, ILogger logger) 21 | { 22 | if (departmentAggregateRepository == (IDepartmentAggregateRepository)null) 23 | throw new ArgumentNullException("departmentAggregateRepository"); 24 | if (logger == (ILogger)null) 25 | throw new ArgumentNullException("logger"); 26 | this._departmentAggregateRepository = departmentAggregateRepository; 27 | this._logger = logger; 28 | } 29 | 30 | 31 | #endregion 32 | 33 | #region IDepartmentAggregateManagementService 34 | /// 35 | /// 36 | /// 37 | /// 38 | /// 39 | /// 40 | public Task AddDepartmentAsync(DepartmentAggregate department, CancellationToken cancellationToken = default(CancellationToken)) 41 | { 42 | cancellationToken.ThrowIfCancellationRequested(); 43 | if (department == (DepartmentAggregate)null) 44 | throw new ArgumentNullException("department"); 45 | _departmentAggregateRepository.Add(department); 46 | return Task.Run(() => 47 | { 48 | _departmentAggregateRepository.UnitOfWork.Commit(); 49 | }); 50 | } 51 | 52 | /// 53 | /// 54 | /// 55 | /// 56 | /// 57 | public Task> GetAllDepartmentsAsync(CancellationToken cancellationToken = default(CancellationToken)) 58 | { 59 | return Task.FromResult>(this._departmentAggregateRepository.GetAllElements()); 60 | } 61 | } 62 | #endregion 63 | 64 | } 65 | -------------------------------------------------------------------------------- /ASP.NET.MVC5.Client.Cloud.Azure/ASP.NET.MVC5.Client.CloudContent/diagnostics.wadcfgx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | true 38 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext.Tests/Infrastructure.Data.BoundedContext.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | 45351e54-6528-493e-b0d8-27c7d7bea1ed 8 | Library 9 | Properties 10 | Infrastructure.Data.BoundedContext.Tests 11 | Infrastructure.Data.BoundedContext.Tests 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Infrastructure.Data.BoundedContext/Repositories/ERPModule/DepartmentAggregateRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Infrastructure.Data.BoundedContext.Repositories.ERPModule 2 | { 3 | using Domain.BoundedContext.ERPModule; 4 | using Infrastructure.CrossCutting.Core; 5 | using Infrastructure.Data.BoundedContext.Resources; 6 | using Infrastructure.Data.BoundedContext.UnitOfWork.Mongo; 7 | using Infrastructure.Data.Core; 8 | using System; 9 | using System.Linq; 10 | public class DepartmentAggregateRepository : Repository, IDepartmentAggregateRepository 11 | { 12 | 13 | #region Constructor 14 | 15 | /// 16 | /// Create a new instance 17 | /// 18 | /// Associated unit of work 19 | /// Associated logger 20 | public DepartmentAggregateRepository(IMongoUnitOfWork unitOfWork, ILogger logger) 21 | : base(unitOfWork, logger) 22 | { 23 | } 24 | 25 | 26 | /// 27 | /// 28 | /// 29 | /// 30 | public override void Add(DepartmentAggregate item) 31 | { 32 | if (item == (DepartmentAggregate)null) 33 | throw new ArgumentNullException(typeof(DepartmentAggregate).ToString(), Messages.CannotAddNullEntity); 34 | var UofW = this.UnitOfWork as IMongoUnitOfWork; 35 | UofW.Departments.Add(item); 36 | } 37 | 38 | /// 39 | /// 40 | /// 41 | /// 42 | /// 43 | public override DepartmentAggregate GetElementById(Guid Id) 44 | { 45 | var UofW = this.UnitOfWork as IQueryableUnitOfWork; 46 | var query = UofW.CreateSet(); 47 | 48 | return query.FirstOrDefault(x => x.Id == Id); 49 | } 50 | 51 | /// 52 | /// 53 | /// 54 | /// 55 | public override IQueryable GetAllElements() 56 | { 57 | var UofW = this.UnitOfWork as IQueryableUnitOfWork; 58 | 59 | return UofW.CreateSet(); 60 | } 61 | 62 | #endregion 63 | } 64 | } 65 | --------------------------------------------------------------------------------