Exemplo n.º 1
0
        public void EditAwards(Guid id, string newName)
        {
            if (File.Exists(GetFilePathByIId(id)))
            {
                throw new FileNotFoundException(
                          string.Format("File with name {0} at path {1} isn't created!", id, JsonFilesPath));
            }

            Awards awards = JsonConvert.DeserializeObject <Awards>(File.ReadAllText(GetFilePathByIId(id)));

            awards.EditName(newName);

            File.WriteAllText(GetFilePathByIId(awards.ID), JsonConvert.SerializeObject(awards));
        }