GraphQL.Code.Generator.Net
1.0.1
Migrated to GraphQL.Code.Generator. One package for Core and Framework
See the version list below for details.
dotnet add package GraphQL.Code.Generator.Net --version 1.0.1
NuGet\Install-Package GraphQL.Code.Generator.Net -Version 1.0.1
<PackageReference Include="GraphQL.Code.Generator.Net" Version="1.0.1" />
paket add GraphQL.Code.Generator.Net --version 1.0.1
#r "nuget: GraphQL.Code.Generator.Net, 1.0.1"
// Install GraphQL.Code.Generator.Net as a Cake Addin #addin nuget:?package=GraphQL.Code.Generator.Net&version=1.0.1 // Install GraphQL.Code.Generator.Net as a Cake Tool #tool nuget:?package=GraphQL.Code.Generator.Net&version=1.0.1
Configuration.TypeClasses.TypeClassesNamespace = "GraphQL.Types.Custom"; // This will translate as namespace GraphQL.Types.Custom {...
Configuration.TypeClasses.EntityClassesNamespacesInclude = new Regex(@"^EntitiesNamespace$", RegexOptions.IgnoreCase); // Any namespace in input dll (where entities classes are) match above regular expression will be included.
Configuration.TypeClasses.EntityClassNamesExclude = new Regex(@"^Rusp.*$|^DatabaseInitializer$|^DBManager$|^DataSeeder$", RegexOptions.IgnoreCase); // Any class match above regular expression will be excluded
Configuration.TypeClasses.AdditionalNamespaces = "MyNamespace1, MyNamespace2";
string path = @"c:\dllFolder\EntitiesAssembly.dll";
Configuration.InputDllNameAndPath = path; Configuration.TypeClasses.EntityClassNamesInclude = new Regex(@"^DomainClass1$|^DomainClass2$", RegexOptions.IgnoreCase); // Any class in input dll (where entities classes are) match above regular expression will be included.
Dictionary<string, string> pluralizationFilter = new Dictionary<string, string>(); pluralizationFilter.Add("Person", "Persons"); Configuration.PluralizationFilter = pluralizationFilter;
Configuration.TypeClasses.AdditionalCodeToBeAddedInConstructor = "InitializePartial();"; //Above setting will create InitializePartial(); in the Type Classes constructor and this can be used to call partial class method. If you don't have InitializePartial in your // partial class or you don't have partial class at all then remove above line. But you can add this later if in all the classes you called some partial class method.
Configuration.RepositoryClass.DBContextPrivateMember = "MyDbContextNamespace.MyDbContextclass _context"; Configuration.RepositoryClass.DBContextConstructorParameter = "MyDbContextNamespace.MyDbContextclass context"; Configuration.RepositoryClass.RepositoryClassName = "CustomRepository"; Configuration.RepositoryClass.RepositoryClassesNamespace = "Custom.Repository.namespace"; Configuration.RepositoryClass.AdditionalNamespaces = "MyNamespace1, MyNamespace2"; //Configuration.RepositoryClass.MethodExcludeFilter = new List<string> { "GetPersons" }; //Configuration.RepositoryClass.IsMethodExcludeFilterApplyToInterface = true;
Configuration.QueryClass.RepositoryConstructorParameter = "RepositoryNamespace.RepositoryClass repositoryConstructorParameterName"; Configuration.QueryClass.RepositoryPrivateMember Configuration.QueryClass.QueryClassName = "CustomGraphQLQuery"; Configuration.QueryClass.QueryClassNamespace = "Graph.Queries"; Configuration.QueryClass.AdditionalNamespaces = "MyNamespace1, MyNamespace2";
int fileCount = GraphQL.Code.Generator.GraphQLCodeGenerator.GenerateGraphQLCode();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net452 is compatible. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
- EntityFramework (>= 6.4.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Changed Nullable boolean parameters to object type. As default Nullable boolean value is false so if boolean argument is not present in GraphQL query results will contain only those rows where that boolean argument is false. By converting to Object in Repository now if Argument is not present then value will be null and results will have all the rows and if Argument value provided only then result will be filtered.