aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio_v2/Tango.BLL/Services/OrganizationsService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio_v2/Tango.BLL/Services/OrganizationsService.cs')
-rw-r--r--Software/Visual_Studio_v2/Tango.BLL/Services/OrganizationsService.cs39
1 files changed, 39 insertions, 0 deletions
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;
+ }
+ }
+}