aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio_v2/Tango.BLL
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio_v2/Tango.BLL')
-rw-r--r--Software/Visual_Studio_v2/Tango.BLL/ObjectBase.cs11
-rw-r--r--Software/Visual_Studio_v2/Tango.BLL/Objects/Organization.cs12
-rw-r--r--Software/Visual_Studio_v2/Tango.BLL/ServiceBase.cs14
-rw-r--r--Software/Visual_Studio_v2/Tango.BLL/Services/OrganizationsService.cs39
-rw-r--r--Software/Visual_Studio_v2/Tango.BLL/Tango.BLL.csproj11
5 files changed, 87 insertions, 0 deletions
diff --git a/Software/Visual_Studio_v2/Tango.BLL/ObjectBase.cs b/Software/Visual_Studio_v2/Tango.BLL/ObjectBase.cs
new file mode 100644
index 000000000..be78b4bc0
--- /dev/null
+++ b/Software/Visual_Studio_v2/Tango.BLL/ObjectBase.cs
@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Tango.BLL
+{
+ public abstract class ObjectBase
+ {
+
+ }
+}
diff --git a/Software/Visual_Studio_v2/Tango.BLL/Objects/Organization.cs b/Software/Visual_Studio_v2/Tango.BLL/Objects/Organization.cs
new file mode 100644
index 000000000..3750fb909
--- /dev/null
+++ b/Software/Visual_Studio_v2/Tango.BLL/Objects/Organization.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Tango.BLL.Objects
+{
+ public class Organization : ObjectBase
+ {
+ public string ID { get; set; }
+ public string Name { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio_v2/Tango.BLL/ServiceBase.cs b/Software/Visual_Studio_v2/Tango.BLL/ServiceBase.cs
new file mode 100644
index 000000000..211d1046c
--- /dev/null
+++ b/Software/Visual_Studio_v2/Tango.BLL/ServiceBase.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Tango.BLL
+{
+ public abstract class ServiceBase<T> : IDisposable where T : ObjectBase
+ {
+ public virtual void Dispose()
+ {
+ //Do nothing.
+ }
+ }
+}
diff --git a/Software/Visual_Studio_v2/Tango.BLL/Services/OrganizationsService.cs b/Software/Visual_Studio_v2/Tango.BLL/Services/OrganizationsService.cs
new file mode 100644
index 000000000..a65952846
--- /dev/null
+++ b/Software/Visual_Studio_v2/Tango.BLL/Services/OrganizationsService.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.BLL.Objects;
+using Tango.DAL;
+using Tango.DAL.Entities;
+using System.Linq;
+
+namespace Tango.BLL.Services
+{
+ public class OrganizationsService : ServiceBase<Organization>
+ {
+ private IRepository<OrganizationEntity> _repository;
+
+ public OrganizationsService(IRepository<OrganizationEntity> repository)
+ {
+ _repository = repository;
+ }
+
+ public async Task<List<Organization>> GetAll()
+ {
+ var entities = await _repository.GetAllAsync();
+
+ List<Organization> organizations = new List<Organization>();
+
+ foreach (var entity in entities)
+ {
+ Organization organization = new Organization();
+ organization.ID = entity.ID;
+ organization.Name = entity.Name;
+
+ organizations.Add(organization);
+ }
+
+ return organizations;
+ }
+ }
+}
diff --git a/Software/Visual_Studio_v2/Tango.BLL/Tango.BLL.csproj b/Software/Visual_Studio_v2/Tango.BLL/Tango.BLL.csproj
new file mode 100644
index 000000000..bc3617fb9
--- /dev/null
+++ b/Software/Visual_Studio_v2/Tango.BLL/Tango.BLL.csproj
@@ -0,0 +1,11 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>netstandard2.0</TargetFramework>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\Tango.DAL\Tango.DAL.csproj" />
+ </ItemGroup>
+
+</Project>