Skip to content

Instantly share code, notes, and snippets.

@azaharafernandezguizan
Created December 30, 2018 17:09
Show Gist options
  • Save azaharafernandezguizan/f7b78e745d99c4b1b227e4b97f730b44 to your computer and use it in GitHub Desktop.
Save azaharafernandezguizan/f7b78e745d99c4b1b227e4b97f730b44 to your computer and use it in GitHub Desktop.
Example of manager implementation on NetCore
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyBusinessLogic;
using MyDBContext.Models;
using MyDTOs;
namespace MyManager
{
public class InfoManager : IInfoManager
{
private IRecursosRepository recursosRepository = new RecursosRepository(new myContext());
public List<RecursosInfo> getRecursos()
{
List<Recursos> objectList = recursosRepository.GetAllRecursos();
return objectList.Select(x => new RecursosInfo
{
RecursoID = x.Id,
Nombre = x.Titulo,
Descripcion = x.Descripcion,
Categoria = x.Categoria
}).ToList();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment