Add project files.
This commit is contained in:
47
StockBL/PersonStockFacade.cs
Normal file
47
StockBL/PersonStockFacade.cs
Normal file
@ -0,0 +1,47 @@
|
||||
using DataDomain;
|
||||
using StockBL.Interface;
|
||||
using StockDAL.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace StockBL
|
||||
{
|
||||
public class PersonStockFacade : IPersonStockFacade
|
||||
{
|
||||
private readonly IStockPersonConnect _stockPersonConnect;
|
||||
private readonly IStockRepository _stockRepository;
|
||||
|
||||
public PersonStockFacade(IStockPersonConnect stockPersonConnect, IStockRepository stockRepository)
|
||||
{
|
||||
_stockPersonConnect = stockPersonConnect;
|
||||
_stockRepository = stockRepository;
|
||||
}
|
||||
|
||||
public IEnumerable<StockMember> GetUnconnectedShares()
|
||||
{
|
||||
var stockList = _stockRepository.GetAllStocks();
|
||||
var connectList = _stockPersonConnect.GetAllConnectedStocks();
|
||||
|
||||
|
||||
var stcList = (from st in stockList
|
||||
where connectList.Any(co => st.Id == co.StockId)
|
||||
select st).ToList();
|
||||
|
||||
var sList = stockList.Except(stcList).ToList();
|
||||
|
||||
return sList;
|
||||
}
|
||||
|
||||
public IEnumerable<StockMember> GetAllSharesConnectedTo(int personId)
|
||||
{
|
||||
var personConnections = _stockPersonConnect.GetAllConnectionsByPersId(personId);
|
||||
var stockList = _stockRepository.GetAllStocks();
|
||||
|
||||
var stcList = (from st in stockList
|
||||
where personConnections.Any(pc => st.Id == pc.StockId)
|
||||
select st).ToList();
|
||||
return stcList;
|
||||
}
|
||||
}
|
||||
}
|
||||
14
StockBL/StockBL.csproj
Normal file
14
StockBL/StockBL.csproj
Normal file
@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DataDomain\DataDomain.csproj" />
|
||||
<ProjectReference Include="..\DatamodelLibrary\DatamodelLibrary.csproj" />
|
||||
<ProjectReference Include="..\StockBL.Interface\StockBL.Interface.csproj" />
|
||||
<ProjectReference Include="..\StockDal.Interface\StockDAL.Interface.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user