Added code for Person / Address
This commit is contained in:
23
StockDAL/AddressRepository.cs
Normal file
23
StockDAL/AddressRepository.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using DataDomain;
|
||||
using DatamodelLibrary;
|
||||
using StockDAL.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StockDAL
|
||||
{
|
||||
public class AddressRepository : IAddressRepository
|
||||
{
|
||||
public Address GetAddressById(int AddressId)
|
||||
{
|
||||
using var context = new StockContext();
|
||||
var entity = (from adr in context.Addresses
|
||||
where adr.Id == AddressId
|
||||
select adr).FirstOrDefault();
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user