public Attachment(DObject obj, IRepository repository) { Id = obj.Id; var type = repository.GetType(obj.TypeId); Title = obj.GetTitle(type); Type = type; if (Type.IsProjectFile()) { FileExtension = Path.GetExtension(Title); } }