Skip to content

Commit 9ec49d4

Browse files
authored
Merge pull request #35 from csharpfritz/main
v0.2.0-preview-1
2 parents 2bfbc49 + a549b49 commit 9ec49d4

26 files changed

+773
-59
lines changed

.dockerignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**/.classpath
2+
**/.dockerignore
3+
**/.env
4+
**/.git
5+
**/.gitignore
6+
**/.project
7+
**/.settings
8+
**/.toolstarget
9+
**/.vs
10+
**/.vscode
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/azds.yaml
15+
**/bin
16+
**/charts
17+
**/docker-compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
21+
**/obj
22+
**/secrets.dev.yaml
23+
**/values.dev.yaml
24+
LICENSE
25+
README.md

CODE-OF-CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to make participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies within all project spaces, and it also applies when
49+
an individual is representing the project or its community in public spaces.
50+
Examples of representing a project or community include using an official
51+
project e-mail address, posting via an official social media account, or acting
52+
as an appointed representative at an online or offline event. Representation of
53+
a project may be further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project leader at [[email protected]](mailto:[email protected]). All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Contributing to InstantAPIs
2+
3+
Thank you for taking the time to consider contributing to our project.
4+
5+
The following is a set of guidelines for contributing to the project. These are mostly guidelines, not rules, and can be changed in the future. Please submit your suggestions with a pull-request to this document.
6+
7+
1. [Code of Conduct](#code-of-conduct)
8+
1. [What should I know before I get started?](#what-should-i-know-before-i-get-started?)
9+
1. [Project Folder Structure](#project-folder-structure)
10+
1. [Design Decisions](#design-decisions)
11+
1. [How can I contribute?](#how-can-i-contribute?)
12+
1. [Work on an Issue in the project](#work-on-an-issue-in-the-project)
13+
1. [Report a Bug](#report-a-bug)
14+
1. [Write documentation](#write-documentation)
15+
16+
17+
## Code of Conduct
18+
19+
We have adopted a [code of conduct](https://github.com/csharpfritz/InstantAPIs/blob/main/CODE-OF-CONDUCT.md) from the Contributor Covenant. Contributors to this project are expected to adhere to this code. Please report unwanted behavior to [[email protected]](mailto:[email protected])
20+
21+
## What should I know before I get started?
22+
23+
This project is currently a proof-of-concept library that generates Minimal API endpoints for an Entity Framework context. You should be
24+
familiar with C# 10, .NET 6, ASP.NET Core, and Entity Framework Core. Reflection and Source Generators are a plus as this project will use those
25+
.NET features to generate HTTP APIs.
26+
27+
### Project Folder Structure
28+
29+
The folders are a basic structure which will change as needed to support the project as it grows. The folders are configured as follows:
30+
31+
```
32+
33+
Fritz.InstantAPIs The project code.
34+
WorkingApi The project to prototype and manually test the functionality being developed.
35+
36+
```
37+
38+
### Design Decisions
39+
40+
Design for this project is ultimately decided by the project lead, [Jeff Fritz](https://github.com/csharpfritz). The following project tenets are adhered to when making decisions:
41+
42+
1. This is a library to help make the simple API endpoints that every project needs.
43+
1. This library is not intended to generate more complex API endpoints.
44+
1. This toolset should help users to deliver APIs with .NET on any and all ASP.NET Core supported platforms
45+
46+
## How can I contribute?
47+
48+
We are always looking for help on this project. There are several ways that you can help:
49+
50+
#### Tool suggestions for contributing
51+
52+
1. [Visual Studio](https://visualstudio.microsoft.com/) (Windows)
53+
2. [Visual Studio Code](https://visualstudio.microsoft.com/) (Windows, Linux, Mac)
54+
3. [Visual Studio For Mac](https://visualstudio.microsoft.com/)
55+
4. Any text editor (Windows, Linux, Mac)
56+
5. Any Web browser.
57+
58+
#### Work on an Issue in the project
59+
60+
1. [Work on an Issue](https://github.com/csharpfritz/InstantAPIs/issues) Choose an Issue that you are interested in working on follow the instruction provided in the link below. We thank you in advance for your contributions.
61+
62+
#### Report a Bug
63+
64+
1. [Report a Bug](https://github.com/csharpfritz/InstantAPIs/issues) with the details of a bug that you have found. Be sure to tag it as a `Bug` so that we can triage and track it.
65+
66+
#### Write documentation
67+
68+
We are always looking for help to add content to the project.
69+
70+
#### Recources
71+
72+
[cmjchrisjones Blog: Contributing To Someone else's git repository](https://cmjchrisjones.dev/posts/contributing-to-someone-elses-git-repository/)

Fritz.InstantAPIs.sln

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{
1212
.github\workflows\build.yaml = .github\workflows\build.yaml
1313
EndProjectSection
1414
EndProject
15+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C73968E9-8A12-401C-BA5D-127C6D5A55D6}"
16+
ProjectSection(SolutionItems) = preProject
17+
CODE-OF-CONDUCT.md = CODE-OF-CONDUCT.md
18+
CONTRIBUTING.md = CONTRIBUTING.md
19+
EndProjectSection
20+
EndProject
21+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{CD123B01-1B52-4E80-84F7-4D10E01EE10F}"
22+
EndProject
1523
Global
1624
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1725
Debug|Any CPU = Debug|Any CPU
@@ -26,6 +34,10 @@ Global
2634
{C945FAF9-D8A9-48EE-8A19-4AB0996CABEC}.Debug|Any CPU.Build.0 = Debug|Any CPU
2735
{C945FAF9-D8A9-48EE-8A19-4AB0996CABEC}.Release|Any CPU.ActiveCfg = Release|Any CPU
2836
{C945FAF9-D8A9-48EE-8A19-4AB0996CABEC}.Release|Any CPU.Build.0 = Release|Any CPU
37+
{CD123B01-1B52-4E80-84F7-4D10E01EE10F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38+
{CD123B01-1B52-4E80-84F7-4D10E01EE10F}.Debug|Any CPU.Build.0 = Debug|Any CPU
39+
{CD123B01-1B52-4E80-84F7-4D10E01EE10F}.Release|Any CPU.ActiveCfg = Release|Any CPU
40+
{CD123B01-1B52-4E80-84F7-4D10E01EE10F}.Release|Any CPU.Build.0 = Release|Any CPU
2941
EndGlobalSection
3042
GlobalSection(SolutionProperties) = preSolution
3143
HideSolutionNode = FALSE

Fritz.InstantAPIs/ApiMethodsToGenerate.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Microsoft.AspNetCore.Builder;
1+
namespace Fritz.InstantAPIs;
22

33
[Flags]
44
public enum ApiMethodsToGenerate
@@ -9,4 +9,16 @@ public enum ApiMethodsToGenerate
99
Update = 8,
1010
Delete = 16,
1111
All = 31
12+
}
13+
14+
public record TableApiMapping(string TableName, ApiMethodsToGenerate MethodsToGenerate = ApiMethodsToGenerate.All);
15+
16+
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
17+
public class ApiMethodAttribute : Attribute
18+
{
19+
public ApiMethodsToGenerate MethodsToGenerate { get; set; }
20+
public ApiMethodAttribute(ApiMethodsToGenerate apiMethodsToGenerate)
21+
{
22+
this.MethodsToGenerate = apiMethodsToGenerate;
23+
}
1224
}
Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,44 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
5-
<ImplicitUsings>enable</ImplicitUsings>
6-
<Nullable>enable</Nullable>
7-
<Authors>csharpfritz</Authors>
8-
<Description>A library that generates Minimal API endpoints for an Entity Framework context.</Description>
9-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
10-
<PackageTags>entity framework, ef, webapi</PackageTags>
11-
<RepositoryType>git</RepositoryType>
12-
<RepositoryUrl>https://github.com/csharpfritz/InstantAPIs</RepositoryUrl>
13-
<PackageReadmeFile>README.md</PackageReadmeFile>
14-
<PackageProjectUrl>https://github.com/csharpfritz/InstantAPIs</PackageProjectUrl>
15-
<PublishRepositoryUrl>true</PublishRepositoryUrl>
16-
<EmbedUntrackedSources>true</EmbedUntrackedSources>
17-
<DebugType>embedded</DebugType>
18-
<Version>0.1.0</Version>
19-
<PackageReleaseNotes>Initial release</PackageReleaseNotes>
20-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<Authors>csharpfritz</Authors>
8+
<Description>A library that generates Minimal API endpoints for an Entity Framework context.</Description>
9+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
10+
<PackageTags>entity framework, ef, webapi</PackageTags>
11+
<RepositoryType>git</RepositoryType>
12+
<RepositoryUrl>https://github.com/csharpfritz/InstantAPIs</RepositoryUrl>
13+
<PackageReadmeFile>README.md</PackageReadmeFile>
14+
<PackageProjectUrl>https://github.com/csharpfritz/InstantAPIs</PackageProjectUrl>
15+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
16+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
17+
<DebugType>embedded</DebugType>
18+
<Version>0.2.0-preview-1</Version>
19+
<PackageReleaseNotes>Introduced a fluent configuration API for defining which tables to include and exclude from the Entity Framework Context.</PackageReleaseNotes>
20+
</PropertyGroup>
21+
22+
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
23+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
24+
</PropertyGroup>
2125

22-
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
23-
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
24-
</PropertyGroup>
25-
2626
<ItemGroup>
2727
<FrameworkReference Include="Microsoft.AspNetCore.App" />
2828
<None Include="..\README.md">
29-
<Pack>True</Pack>
30-
<PackagePath>\</PackagePath>
29+
<Pack>True</Pack>
30+
<PackagePath>\</PackagePath>
3131
</None>
3232
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.2" />
3333
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
34-
</ItemGroup>
34+
</ItemGroup>
3535

3636
<ItemGroup>
3737
<Using Include="Fritz.InstantAPIs" />
3838
<Using Include="Microsoft.EntityFrameworkCore"></Using>
39+
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
40+
<_Parameter1>Test</_Parameter1>
41+
</AssemblyAttribute>
3942
</ItemGroup>
4043

4144
</Project>

0 commit comments

Comments
 (0)