-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from DeeJayTC/vnext
Vnext
- Loading branch information
Showing
47 changed files
with
1,150 additions
and
431 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,111 @@ | ||
using System; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
using TCDev.ApiGenerator.Attributes; | ||
using TCDev.ApiGenerator.Interfaces; | ||
//using System; | ||
//using System.Collections.Generic; | ||
//using System.ComponentModel.DataAnnotations; | ||
//using System.ComponentModel.DataAnnotations.Schema; | ||
//using TCDev.ApiGenerator.Attributes; | ||
//using TCDev.ApiGenerator.Interfaces; | ||
|
||
//namespace ApiGeneratorSampleApI.Model | ||
//{ | ||
|
||
// [Api("/students")] | ||
// public class Student: IObjectBase<int> | ||
// { | ||
// public int Id { get; set; } | ||
// public string FirstName { get; set; } | ||
// public string LastName { get; set; } | ||
// public DateTime DateOfBirth { get; set; } | ||
|
||
// public void BeforeDelete(Student student) | ||
// { | ||
// // Before Delete hook to make custom validations | ||
// } | ||
|
||
// } | ||
|
||
|
||
// [Api("/teachers")] | ||
// public class Teacher : IObjectBase<int> | ||
// { | ||
// public int Id { get; set; } | ||
// public string FirstName { get; set; } | ||
// public string LastName { get; set; } | ||
// public DateTime DateOfBirth { get; set; } | ||
|
||
// public void BeforeCreate(Teacher newTeacher) | ||
// { | ||
// // Before Create hook to make custom validations | ||
// } | ||
// } | ||
|
||
|
||
// [Api("/courses")] | ||
// public class Course : IObjectBase<int> | ||
// { | ||
// public int Id { get; set; } | ||
// public List<Student> Students { get; set; } | ||
// public Teacher Teacher { get; set; } | ||
// public List<DateTime> Schedule { get; set; } | ||
// } | ||
|
||
|
||
|
||
|
||
// [Api("/car"] | ||
// public class Car : IObjectBase<Guid> | ||
// { | ||
// [Key] | ||
// [DatabaseGenerated(DatabaseGeneratedOption.Identity)] | ||
// [SwaggerIgnore] | ||
// public Guid Id { get; set; } = Guid.NewGuid(); | ||
|
||
|
||
// [EmailAddress] | ||
// public string Name { get; set; } | ||
|
||
// public string Description { get; set; } | ||
|
||
// public string Color { get; set; } | ||
|
||
// public Make? Make { get; set; } | ||
|
||
// public Model? Model { get; set; } | ||
// } | ||
|
||
|
||
// [Api("/carMakes", | ||
// authorize: true, | ||
// requiredReadScopes: new string[] { "make.read" }, | ||
// requiredWriteScopes: new string[] { "make.write" })] | ||
// public class Make : IObjectBase<Guid> | ||
// { | ||
// [Key] | ||
// [DatabaseGenerated(DatabaseGeneratedOption.Identity)] | ||
// [SwaggerIgnore] | ||
// public Guid Id { get; set; } = Guid.NewGuid(); | ||
// public string Name { get; set; } | ||
|
||
// public string Description { get; set; } | ||
|
||
|
||
// public Model? Model { get; set; } | ||
// } | ||
|
||
|
||
|
||
// [Api("/carModel", | ||
// authorize: true, | ||
// requiredReadScopes: new string[] { "model.read" }, | ||
// requiredWriteScopes: new string[] { "model.write" })] | ||
// public class Model : IObjectBase<Guid>, I | ||
// { | ||
// [Key] | ||
// [DatabaseGenerated(DatabaseGeneratedOption.Identity)] | ||
// [SwaggerIgnore] | ||
// public Guid Id { get; set; } = Guid.NewGuid(); | ||
// public string Name { get; set; } | ||
|
||
namespace ApiGeneratorSampleApI.Model | ||
{ | ||
// public string Description { get; set; } | ||
// } | ||
|
||
[Api("/car", | ||
authorize: true, | ||
requiredReadScopes: new string[] { "car.read" }, | ||
requiredWriteScopes: new string[] { "car.write" })] | ||
public class Car : IObjectBase<Guid> | ||
{ | ||
[Key] | ||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] | ||
[SwaggerIgnore] | ||
public Guid Id { get; set; } = Guid.NewGuid(); | ||
|
||
|
||
[EmailAddress] | ||
public string Name { get; set; } | ||
|
||
public string Description { get; set; } | ||
|
||
public string Color { get; set; } | ||
|
||
public Make? Make { get; set; } | ||
|
||
public Model? Model { get; set; } | ||
} | ||
|
||
|
||
[Api("/carMakes", | ||
authorize: true, | ||
requiredReadScopes: new string[] { "make.read" }, | ||
requiredWriteScopes: new string[] { "make.write" })] | ||
public class Make : IObjectBase<Guid> | ||
{ | ||
[Key] | ||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] | ||
[SwaggerIgnore] | ||
public Guid Id { get; set; } = Guid.NewGuid(); | ||
public string Name { get; set; } | ||
|
||
public string Description { get; set; } | ||
|
||
|
||
public Model? Model { get; set; } | ||
} | ||
|
||
|
||
|
||
[Api("/carModel", | ||
authorize: true, | ||
requiredReadScopes: new string[] { "model.read" }, | ||
requiredWriteScopes: new string[] { "model.write" })] | ||
public class Model : IObjectBase<Guid> | ||
{ | ||
[Key] | ||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] | ||
[SwaggerIgnore] | ||
public Guid Id { get; set; } = Guid.NewGuid(); | ||
public string Name { get; set; } | ||
|
||
public string Description { get; set; } | ||
} | ||
|
||
} | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
// TCDev.de 2022/03/24 | ||
// ApiGeneratorSampleApI.MinimalSample.cs | ||
// https://github.com/DeeJayTC/net-dynamic-api | ||
//// TCDev.de 2022/03/24 | ||
//// ApiGeneratorSampleApI.MinimalSample.cs | ||
//// https://github.com/DeeJayTC/net-dynamic-api | ||
|
||
using TCDev.ApiGenerator.Attributes; | ||
using TCDev.ApiGenerator.Interfaces; | ||
//using TCDev.ApiGenerator.Attributes; | ||
//using TCDev.ApiGenerator.Interfaces; | ||
|
||
namespace ApiGeneratorSampleApI.Model | ||
{ | ||
/// <summary> | ||
/// This is the minimal sample, yes this is a working api ;) | ||
/// </summary> | ||
[Api("/minimal")] | ||
public class MinimalSample : IObjectBase<int> | ||
{ | ||
public string Name { get; set; } | ||
public int Value { get; set; } | ||
public int Id { get; set; } | ||
} | ||
} | ||
//namespace ApiGeneratorSampleApI.Model | ||
//{ | ||
// /// <summary> | ||
// /// This is the minimal sample, yes this is a working api ;) | ||
// /// </summary> | ||
// [Api("/minimal")] | ||
// public class MinimalSample : IObjectBase<int> | ||
// { | ||
// public string Name { get; set; } | ||
// public int Value { get; set; } | ||
// public int Id { get; set; } | ||
// } | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.