Commit 62b47efb authored by fakhriaunur's avatar fakhriaunur

Adding Portal Entity, Service, Infrastructure, excluding Web

parent f089b9b5
Pipeline #22762 passed with stage
in 0 seconds
# Default ignored files
/.idea.SIX/.idea/workspace.xml
namespace SIX.Core.Enum
{
public enum PortalStateEnum
{
Closed = 0,
Opening = 1,
Opened = 2,
Closing = 3,
}
}
\ No newline at end of file
namespace SIX.Core.Enum
{
public enum VehicleEnum
{
Motorbike = 2,
Car = 4
}
}
\ No newline at end of file
using System;
using SIX.Core.Enum;
namespace SIX.Core.Portal
{
public class Portal
{
public Guid VehicleId { get; set; }
public VehicleEnum VehicleType { get; set; }
public DateTime TimeEnterParking { get; set; }
public DateTime? TimeLeaveParking { get; set; }
public PortalStateEnum PortalState { get; set; }
}
}
\ No newline at end of file
namespace SIX.Infrastructure.DataContext
{
public class Portal : BaseDataContext
{
public string Name { get; set; }
}
}
\ No newline at end of file
......@@ -20,5 +20,6 @@ namespace SIX.Infrastructure.DataContext
public DbSet<Zone> Zones { get; set; }
public DbSet<Slot> Slot { get; set; }
public DbSet<UserOnline> UserOnlines { get; set; }
public DbSet<Portal> Portals { get; set; }
}
}
using SIX.Infrastructure.DataContext;
namespace SIX.Infrastructure.Repositories
{
public interface IPortalRepository : IBaseRepository<Portal>
{
}
}
\ No newline at end of file
using SIX.Infrastructure.DataContext;
namespace SIX.Infrastructure.Repositories
{
public class PortalRepository : BaseRepository<Portal>,IPortalRepository
{
public PortalRepository(SIXDbContext dbContext) : base(dbContext)
{
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
namespace SIX.Service.Portal
{
public interface IPortalService
{
IReadOnlyList<Core.Portal.Portal> GetAll();
Core.Portal.Portal GetById(Guid Id);
void Add(Core.Portal.Portal portal);
void Edit(Core.Portal.Portal portal);
void Remove(Guid Id);
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
namespace SIX.Service.Portal
{
public class PortalService : IPortalService
{
private readonly Infrastructure.Repositories.IPortalRepository _portalRepository;
public PortalService(Infrastructure.Repositories.IPortalRepository portalRepository)
{
_portalRepository = portalRepository;
}
public IReadOnlyList<Core.Portal.Portal> GetAll()
{
return _portalRepository.GetAll().Select(x => new Core.Portal.Portal
{
VehicleId = x.Id,
VehicleType = x.
}).ToList();
throw new NotImplementedException();
}
public Core.Portal.Portal GetById(Guid Id)
{
throw new NotImplementedException();
}
public void Add(Core.Portal.Portal portal)
{
throw new NotImplementedException();
}
public void Edit(Core.Portal.Portal portal)
{
throw new NotImplementedException();
}
public void Remove(Guid Id)
{
throw new NotImplementedException();
}
}
}
\ No newline at end of file
......@@ -14,6 +14,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
using SIX.Infrastructure.Repositories;
using SIX.Service.Location;
using SIX.Service.Slot;
using SIX.Service.Zone;
using SIX.Service.UserOnline;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment