You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Dotnet-WebAPI/Converters/ModelToEntities.cs

22 lines
624 B

using AppContext.Entities;
using Model;
namespace Converters;
public static class EntitiesToModels
{
public static User ToModel(this UserEntity entity)
{
return new User(entity.Id, entity.Name, entity.Email, entity.ProfilePicture, entity.IsAdmin);
}
public static Tactic ToModel(this TacticEntity entity)
{
return new Tactic(entity.Id, entity.Name, entity.OwnerId, entity.Type, entity.CreationDate);
}
public static Team ToModel(this TeamEntity entity)
{
return new Team(entity.Id, entity.Name, entity.Picture, entity.MainColor, entity.SecondColor);
}
}