public static async Task <EditTimeEntryViewModel> Init(Guid timeEntryId) { TimeEntryData data; List <TagData> tagList; if (timeEntryId == Guid.Empty) { data = TimeEntryModel.GetDraft(); tagList = await GetDefaultTagList(data.WorkspaceId); } else { data = await TimeEntryModel.GetTimeEntryDataAsync(timeEntryId); tagList = await ServiceContainer.Resolve <IDataStore> ().GetTimeEntryTags(timeEntryId); } return(new EditTimeEntryViewModel(data, tagList)); }
public static async Task <EditTimeEntryViewModel> Init(Guid timeEntryId) { TimeEntryData data; List <TagData> tagList; if (timeEntryId == Guid.Empty) { data = TimeEntryModel.GetDraft(); tagList = await GetDefaultTagList(data.WorkspaceId); } else { data = await TimeEntryModel.GetTimeEntryDataAsync(timeEntryId); var tagsView = await TimeEntryTagCollectionView.Init(timeEntryId); tagList = tagsView.Data.ToList(); } return(new EditTimeEntryViewModel(data, tagList)); }