public void GenerateServiceFactoryInterface(VSNetCSharpProject bdProj) { string projectName = bdProj.ProjectName; string sFIntFileName = GenerationHelper.GetSFIntFileName(); string str3 = m_Arch.BusinessDocsLayer.FullPath + sFIntFileName; bdProj.AddFile(sFIntFileName); CSharpFile file = CSharpFilePool.Obtain(str3); file.NameSpace = bdProj.ProjectName; TraceInfoEvent.Raise("Adding service factory interface."); file.Description = "Service factory interface."; CSharpInterfaceDef typeDef = new CSharpInterfaceDef(); file.InnerTypes.Add(typeDef); typeDef.Comment.Summary = file.Description; typeDef.HeaderLine = "public interface IServiceFactory"; foreach (ServiceLayerModel model in m_Arch.ServiceLayers) { foreach (ServiceModel model2 in model.Services) { CSharpMethodDef def2 = new CSharpMethodDef(); def2.Comment.Summary = string.Format("Gets the service interface for '{0}'.", model2.MappingName); def2.HeaderLine = string.Format("I{0} Get{0}", model2.MappingName); typeDef.Methods.Add(def2); } } }
public void GenerateSnippetInterface(CSharpFile docFile, ServiceModel srv) { docFile.Description = string.Format("Interface for '{0}' entity.", srv.MappingName); docFile.Usings.Add("Grepton.Runtime"); docFile.Usings.Add("Grepton.Runtime.DBTypes"); CSharpTypeDef typeDef = new CSharpInterfaceDef(); docFile.InnerTypes.Add(typeDef); typeDef.Comment.Summary = docFile.Description; typeDef.HeaderLine = string.Format("public interface I{0}: I{0}Base", srv.MappingName); }
public void GenerateBaseInterface(CSharpFile docFile, ServiceModel srv) { docFile.Description = string.Format("Base interface for '{0}' entity.", srv.MappingName); docFile.Usings.Add("Grepton.Runtime"); docFile.Usings.Add("Grepton.Runtime.DBTypes"); CSharpTypeDef typeDef = new CSharpInterfaceDef(); docFile.InnerTypes.Add(typeDef); typeDef.Comment.Summary = docFile.Description; typeDef.HeaderLine = string.Format("public interface I{0}Base", srv.MappingName); if (!m_Arch.DisableBaseInterfaces) { foreach (OperationModel model in srv.Operations) { IOperationCodeGenerator codeGenerator = model.GetCodeGenerator(); if (codeGenerator.WantGenerateServiceMethod()) { codeGenerator.GenerateInterface(typeDef); } } } }