Skip to content

Commit 7a7e011

Browse files
authored
Merge pull request #7 from Mathavana/develop
Develop - Unit Test added
2 parents 18db4ca + 5b9e454 commit 7a7e011

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+239
-176
lines changed

.gitignore

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
1-
.vs/**
2-
Supermarket.Entites/bin/**
3-
Supermarket.Entites/obj/**
4-
Supermarket.Identity/bin/**
5-
Supermarket.Identity/obj/**
6-
Supermarket.Persistent/bin/**
7-
Supermarket.Persistent/obj/**
8-
Supermarket/bin/**
9-
Supermarket/obj/**
10-
Supermarket/LogFiles/**
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
4+
# User-specific files
5+
*.suo
6+
*.user
7+
*.userosscache
8+
*.sln.docstates
9+
10+
# Build results
11+
[Dd]ebug/
12+
[Dd]ebugPublic/
13+
[Rr]elease/
14+
[Rr]eleases/
15+
x64/
16+
x86/
17+
bld/
18+
[Bb]in/
19+
[Oo]bj/
20+
[Ll]og/
21+
22+
# Visual Studio 2015 cache/options directory
23+
.vs/
24+
25+
# Log Files
26+
LogFiles/

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ We will try to create an API application using asp.net core.
77
- Swagger for API Document
88
- API Version
99
- Logging (Serilog)
10+
- API Analyzer added - For proper swagger documentation
11+
- Model.IsValid is removed in each controller. (ApiController auto implement Model.IsValid)
12+
- Models, Enums, Context, Repositories moved to Supermarket.Core project
13+
- xUnit Test Project added
1014

1115
### Next ToDo List:
1216
- Role Based Authentication/Authorization

Supermarket.Identity/Context/AuthenticationContext.cs renamed to Supermarket.Core/Context/AuthenticationContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
22
using Microsoft.EntityFrameworkCore;
3-
using Supermarket.Identity.Models;
3+
using Supermarket.Core.Models;
44

5-
namespace Supermarket.Identity.Context
5+
namespace Supermarket.Core.Context
66
{
77
public class AuthenticationContext : IdentityDbContext
88
{

Supermarket.Persistent/Context/RepositoryContext.cs renamed to Supermarket.Core/Context/RepositoryContext.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
using Microsoft.EntityFrameworkCore;
2-
using Supermarket.Entites.Models;
2+
using Supermarket.Core.Models;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Text;
36

4-
namespace Supermarket.Persistent.Context
7+
namespace Supermarket.Core.Context
58
{
69
public class RepositoryContext : DbContext
710
{

Supermarket.Entites/Enums/UnitOfMeasurement.cs renamed to Supermarket.Core/Enums/UnitOfMeasurement.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.ComponentModel;
22

3-
namespace Supermarket.Entites.Enums
3+
namespace Supermarket.Core.Enums
44
{
55
public enum UnitOfMeasurement
66
{

Supermarket.Identity/Migrations/20190316080724_InitialCreate.Designer.cs renamed to Supermarket.Core/Migrations/20190322141201_InitialCreate.Designer.cs

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Supermarket.Identity/Migrations/20190316080724_InitialCreate.cs renamed to Supermarket.Core/Migrations/20190322141201_InitialCreate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using Microsoft.EntityFrameworkCore.Metadata;
33
using Microsoft.EntityFrameworkCore.Migrations;
44

5-
namespace Supermarket.Identity.Migrations
5+
namespace Supermarket.Core.Migrations
66
{
77
public partial class InitialCreate : Migration
88
{

Supermarket.Identity/Migrations/AuthenticationContextModelSnapshot.cs renamed to Supermarket.Core/Migrations/AuthenticationContextModelSnapshot.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
using Microsoft.EntityFrameworkCore.Infrastructure;
55
using Microsoft.EntityFrameworkCore.Metadata;
66
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
7-
using Supermarket.Identity.Context;
7+
using Supermarket.Core.Context;
88

9-
namespace Supermarket.Identity.Migrations
9+
namespace Supermarket.Core.Migrations
1010
{
1111
[DbContext(typeof(AuthenticationContext))]
1212
partial class AuthenticationContextModelSnapshot : ModelSnapshot
@@ -189,7 +189,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
189189
b.ToTable("AspNetUserTokens");
190190
});
191191

192-
modelBuilder.Entity("Supermarket.Identity.Models.ApplicationUser", b =>
192+
modelBuilder.Entity("Supermarket.Core.Models.ApplicationUser", b =>
193193
{
194194
b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser");
195195

Supermarket.Identity/Models/ApplicationUser.cs renamed to Supermarket.Core/Models/ApplicationUser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using Microsoft.AspNetCore.Identity;
22
using System.ComponentModel.DataAnnotations.Schema;
33

4-
namespace Supermarket.Identity.Models
4+
namespace Supermarket.Core.Models
55
{
66
public class ApplicationUser : IdentityUser
77
{
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
using System.Collections.Generic;
1+
using System;
2+
using System.Collections.Generic;
23

3-
namespace Supermarket.Entites.Models
4+
namespace Supermarket.Core.Models
45
{
56
public class Category : IEntity
67
{
78
public int Id { get; set; }
89
public string Name { get; set; }
910
public IList<Product> Products { get; set; } = new List<Product>();
11+
public DateTime DateAdded { get; set; }
12+
public DateTime DateModified { get; set; }
1013
}
1114
}

0 commit comments

Comments
 (0)