Пример #1
0
 /// <summary>
 /// Create a new CrewManifest with default values
 /// </summary>
 /// <returns></returns>
 public CrewManifestModel Create()
 {
     CrewManifestModel crewManifest = new CrewManifestModel {
         Crew = new List<CrewMemberModel>(),
         Name = "NCC Over 9000"
     };
     return crewManifest;
 }
Пример #2
0
        private bool WriteData(CrewManifestModel manifestModel)
        {
            // Write out the Json
            var filePath = HostingEnvironment.MapPath(_filePath);

            var json = JsonConvert.SerializeObject(manifestModel, Formatting.Indented);
            File.WriteAllText(filePath, json);

            return true;
        }
Пример #3
0
        /// <summary>
        /// Saves a new CrewManifest
        /// </summary>
        /// <param name="crewManifest"></param>
        /// <returns></returns>
        public CrewManifestModel Save(CrewManifestModel crewManifest)
        {
            WriteData(crewManifest);

            return crewManifest;
        }