forked from emonney/QuickApp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
141 additions
and
9 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
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,16 @@ | ||
using DAL.Models; | ||
using DAL.Repositories.Interfaces; | ||
using Microsoft.EntityFrameworkCore; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace DAL.Repositories | ||
{ | ||
public class AreaMasterRepository : Repository<AreaMaster>, IAreaMasterRepository | ||
{ | ||
public AreaMasterRepository(DbContext context) : base(context){ } | ||
} | ||
} |
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,13 @@ | ||
using DAL.Models; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace DAL.Repositories.Interfaces | ||
{ | ||
public interface IAreaMasterRepository : IRepository<AreaMaster> | ||
{ | ||
} | ||
} |
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
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 @@ | ||
<p>area works!</p> |
Empty file.
23 changes: 23 additions & 0 deletions
23
QuickApp/ClientApp/src/app/components/area/area.component.spec.ts
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,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { AreaComponent } from './area.component'; | ||
|
||
describe('AreaComponent', () => { | ||
let component: AreaComponent; | ||
let fixture: ComponentFixture<AreaComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ AreaComponent ] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(AreaComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
15 changes: 15 additions & 0 deletions
15
QuickApp/ClientApp/src/app/components/area/area.component.ts
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 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-area', | ||
templateUrl: './area.component.html', | ||
styleUrls: ['./area.component.scss'] | ||
}) | ||
export class AreaComponent implements OnInit { | ||
|
||
constructor() { } | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
} |
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,43 @@ | ||
using AutoMapper; | ||
using DAL; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.Extensions.Logging; | ||
using QuickApp.Helpers; | ||
using QuickApp.ViewModels; | ||
using System.Collections.Generic; | ||
|
||
namespace QuickApp.Controllers | ||
{ | ||
[Route("api/[controller]")] | ||
public class AreaMasterController : ControllerBase | ||
{ | ||
private readonly IMapper _mapper; | ||
private readonly IUnitOfWork _unitOfWork; | ||
private readonly ILogger _logger; | ||
private readonly IEmailSender _emailSender; | ||
|
||
public AreaMasterController(IMapper mapper, IUnitOfWork unitOfWork, ILogger<CustomerController> logger, IEmailSender emailSender) | ||
{ | ||
_mapper = mapper; | ||
_unitOfWork = unitOfWork; | ||
_logger = logger; | ||
_emailSender = emailSender; | ||
} | ||
|
||
// GET: api/values | ||
[HttpGet("{user}")] | ||
public IActionResult Get(int user) | ||
{ | ||
var allAreaMasters = _unitOfWork.AreaMaster.Find(x=>x.UserId== user); | ||
return Ok(_mapper.Map<IEnumerable<AreaMasterViewModel>>(allAreaMasters)); | ||
} | ||
|
||
// GET api/values/5 | ||
[HttpGet("{user}/{id}")] | ||
public string Get(int user,int id) | ||
{ | ||
return "value: " + user + id; | ||
} | ||
} | ||
} |
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,9 @@ | ||
namespace QuickApp.ViewModels | ||
{ | ||
public class AreaMasterViewModel | ||
{ | ||
public int Id { get; set; } | ||
public string AreaCode { get; set; } | ||
public string AreaDesc { get; set; } | ||
} | ||
} |