public static RoleDto Read(int id) { using (var db = new MainDBModelContainer()) { var data = db.RoleSet.Find(id); if (data != null) { return(RoleMapper.EntityToDto(data)); } throw new ElementNotFoundException(); } }