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.
16 lines
573 B
16 lines
573 B
using Model.Players;
|
|
|
|
namespace Data.EF.Players
|
|
{
|
|
public static class PlayerExtensions
|
|
{
|
|
public static Player ToModel(this PlayerEntity entity) => new(name: entity.Name);
|
|
|
|
public static IEnumerable<Player> ToModels(this IEnumerable<PlayerEntity> entities) => entities.Select(entity => entity.ToModel());
|
|
|
|
public static PlayerEntity ToEntity(this Player model) => new() { Name = model.Name };
|
|
|
|
public static IEnumerable<PlayerEntity> ToEntities(this IEnumerable<Player> models) => models.Select(model => model.ToEntity());
|
|
}
|
|
}
|