public StudentController(IUnitOfWork unitOfWork, IStudentRepository studentRepository, IProjectRepository projectRepository, StudentAssembler studentAssembler, ProjectAssembler projectAssembler) { _unitOfWork = unitOfWork; _studentRepository = studentRepository; _projectRepository = projectRepository; _studentAssembler = studentAssembler; _projectAssembler = projectAssembler; }
public CustomersController(IUnitOfWork unitOfWork, ICustomerRepository customerRepository, IUserRepository userRepository, IProjectRepository projectRepository, CustomerAssembler customerAssembler, UserAssembler userAssembler, ProjectAssembler projectAssembler) { _unitOfWork = unitOfWork; _customerRepository = customerRepository; _userRepository = userRepository; _projectRepository = projectRepository; _customerAssembler = customerAssembler; _userAssembler = userAssembler; _projectAssembler = projectAssembler; }
static void Main(string[] args) { //ConfigurationConvertor.Convert( // @"E:\assetasyst.xml", // @"E:\assetasyst.proj.xml"); var assembler = new ProjectAssembler(new ConfigurationAssembler(new SubjectAssembler(new FieldAssembler(new ParserAssembler())))); var serializer = new System.Xml.Serialization.XmlSerializer(typeof(ProjectDTO)); Project p; //var dto = assembler.Create(new Project() { Configuration = new dbqf.tests.Chinook() }); //var list = new List<dbqf.Serialization.DTO.Parsers.ParserDTO>(); //list.Add(new dbqf.Serialization.DTO.Parsers.DelimitedParserDTO(new string[] { ",", ";", "<", Environment.NewLine, "\"", "\t" })); //list.Add(new dbqf.Serialization.DTO.Parsers.ConvertParserDTO() { FromType = typeof(object).FullName, ToType = typeof(string).FullName }); //dto.Configuration.Subjects[0].Fields[0].Parsers = list; //File.Delete(@"E:\chinook.proj.xml"); //var ws = new System.Xml.XmlWriterSettings(); //ws.Indent = true; //ws.IndentChars = " "; //ws.CheckCharacters = true; //using (XmlWriter writer = XmlWriter.Create(@"E:\chinook.proj.xml", ws)) // serializer.Serialize(writer, dto); //File.WriteAllText(@"E:\AssetAsystConfiguration.cs", new FluentGenerator().Generate(new dbqf.tests.Chinook(), "dbqf.tests", "Chinook")); //p = new Project() //{ // Id = Guid.NewGuid(), // Configuration = Build(), // Connections = new List<Connection>() // { // new Connection() // { // ConnectionType = "SqlClient", // DisplayName = "Live", // Identifier = "live", // ConnectionString = "Server=LAU-SQL2005;Database=DownloadCentre;Trusted_Connection=True;" } // } //}; //var dto = assembler.Create(p); //dto.Configuration[0].Fields[1].Parsers.Add(new ParserDTO() { TypeName = typeof(DelimitedParser).Name, Delimiters = new string[] { "," } }); //using (TextWriter writer = new StreamWriter(@"E:\Users\sattenborrow\Documents\Visual Studio 2010\Projects\db-query-framework\configurations\download-centre.proj.xml")) // serializer.Serialize(writer, dto); var rs = new XmlReaderSettings(); rs.CheckCharacters = true; // required to read special characters like new line and tab using (XmlReader reader = XmlReader.Create(@"E:\assetasyst.proj.xml", rs)) p = assembler.Restore((ProjectDTO)serializer.Deserialize(reader)); //var validator = new ConfigurationValidation(p.Configuration, new SqlConnection(p.Connections[0].ConnectionString)); var validator = new ConfigurationValidation(new dbqf.AssetAsyst.AssetAsystConfiguration(), new SqlConnection(@"Server=(local)\sql2012;Database=AMS_Pittsh;Trusted_Connection=True;")); validator.Validate(); //File.WriteAllText(@"E:\assetasyst.cs", new FluentGenerator().Generate(p.Configuration, "dbqf.AssetAsyst", "Configuration")); //var validator = new ConfigurationValidation(p.Configuration, new SqlConnection(p.Connections[0].ConnectionString)); //validator.Validate(true); Console.WriteLine("\nDone."); Console.ReadKey(); }
public static Project Get(CodeBase codebase) { return(ProjectAssembler.Assemble(codebase)); }