aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio_v2/Tango.BLL/Services/OrganizationsService.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-08-06 10:41:16 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-08-06 10:41:16 +0300
commite86fe2e8cf34343cf3ebbf4640b2be5e85899615 (patch)
treedee59a2c43b69b6abe20be24059d42ecabcdfffc /Software/Visual_Studio_v2/Tango.BLL/Services/OrganizationsService.cs
parentc1b00ec58a47e504e0247c21c96b55a89e7a95eb (diff)
downloadTango-e86fe2e8cf34343cf3ebbf4640b2be5e85899615.tar.gz
Tango-e86fe2e8cf34343cf3ebbf4640b2be5e85899615.zip
v2 Basic structure.
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;
+ }
+ }
+}