-
Notifications
You must be signed in to change notification settings - Fork 679
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support polymorphic types in model generation
- Loading branch information
1 parent
515c4ba
commit a8e84cc
Showing
8 changed files
with
166 additions
and
8 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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Web.Http; | ||
using Swashbuckle.TestApp.Models; | ||
|
||
namespace Swashbuckle.TestApp.Controllers | ||
{ | ||
public class ProductsController : ApiController | ||
{ | ||
public IEnumerable<Product> GetAll() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
namespace Swashbuckle.TestApp.Models | ||
{ | ||
public abstract class Product | ||
{ | ||
public int Id { get; set; } | ||
|
||
public decimal Price { get; set; } | ||
} | ||
|
||
public class Book : Product | ||
{ | ||
public string Title { get; set; } | ||
|
||
public string Author { get; set; } | ||
} | ||
|
||
public class Album : Product | ||
{ | ||
public string Name { get; set; } | ||
|
||
public string Artist { get; set; } | ||
} | ||
|
||
public abstract class Service : Product | ||
{} | ||
|
||
public class Shipping : Service | ||
{} | ||
|
||
public class Packaging : Service | ||
{} | ||
} |
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
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
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