private List <MovieMetaDataModel> GetMovieMetaDataModelsFromFile() { var fileSavePath = Path.Combine("Data", "metadata.csv"); if (!File.Exists(fileSavePath)) { return(new List <MovieMetaDataModel>()); } var dataRows = FileHelper.GetDataFromFile(fileSavePath); if (dataRows.Any()) { var list = new List <MovieMetaDataModel>(); foreach (var item in dataRows) { var element = new MovieMetaDataModel(); element.duration = item["duration"].ToString(); element.language = item["language"].ToString(); element.movieId = int.Parse(item["movieId"].ToString()); element.releaseYear = int.Parse(item["releaseYear"].ToString()); element.title = item["title"].ToString(); list.Add(element); } return(list); } return(new List <MovieMetaDataModel>()); }
/// <summary> /// /// </summary> /// <param name="model"></param> public void CreateMovieMetaDataModel(MovieMetaDataModel model) { movieMetaDataModels.Add(model); }
public void Post([FromBody] MovieMetaDataModel model) { MoviceService.CreateMovieMetaDataModel(model); }