Fully implemented the surface service which contains all storage logic

This commit is contained in:
Robert committed 2019-10-22 14:28:11 +02:00
1 parent 04c5aa40fc
commit c4e5e412e0
8 files changed
+284 -117

No files matched your search

@@ -7,6 +7,7 @@ namespace Artemis.Storage.Repositories.Interfaces
public interface ISurfaceRepository : IRepository
{
void Add(SurfaceEntity surfaceEntity);
void Remove(SurfaceEntity surfaceEntity);
SurfaceEntity Get(string name);
Task<SurfaceEntity> GetAsync(string name);
List<SurfaceEntity> GetAll();
@@ -22,6 +22,11 @@ namespace Artemis.Storage.Repositories
_dbContext.Surfaces.Add(surfaceEntity);
}
public void Remove(SurfaceEntity surfaceEntity)
{
_dbContext.Surfaces.Remove(surfaceEntity);
}
public SurfaceEntity Get(string name)
{
return _dbContext.Surfaces.Include(s => s.SurfacePositions).FirstOrDefault(p => p.Name == name);