public ICourse UpdateCourse(ICourse c) { var entity = new CourseEntity(c); resourceTable.Execute(TableOperation.InsertOrReplace(entity)); return(entity.ToCourse()); }
public static ICourse ToCourse(this CourseEntity entity) { return(new Course { Id = int.Parse(entity.RowKey), ExpirationTime = entity.ExpirationTime, Name = entity.Name, State = (CourseState)Enum.Parse(typeof(CourseState), entity.State) }); }