public static Hobby ToDto(Db.Hobby hobby) { return hobby == null ? null : new Hobby { HobbyId = hobby.HobbyId, HobbyName = hobby.HobbyName, UserId = hobby.UserId, CreatedBy = hobby.CreatedBy, CreatedDate = hobby.CreatedDate, ModifiedBy = hobby.ModifiedBy, ModifiedDate = hobby.ModifiedDate }; }