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