private static void Read(string entityName) { string nameParseResult = TryParseProperty.TryParseStringProperty(Localize.PropertyName, entityName); Console.WriteLine(Localize.Reading + "..."); try { CRUDOperations.ReadEntity(nameParseResult, Guid.Empty, false); Console.WriteLine(String.Format(Localize.Done, entityName, Localize.Read)); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
private static void ReadById(string entityName) { Guid guidParseResult = TryParseProperty.TryParseGuidProperty(Localize.PropertyId, entityName); Console.WriteLine(Localize.Reading + "..."); try { CRUDOperations.ReadEntity(String.Empty, guidParseResult, true); Console.WriteLine(String.Format(Localize.Done, entityName, Localize.Read)); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
private static void Delete(string entityName) { Guid IdParseResult = TryParseProperty.TryParseGuidProperty(Localize.PropertyId, entityName); Console.WriteLine(Localize.Deleting + "..."); try { CRUDOperations.DeleteEntity(IdParseResult); Console.WriteLine(String.Format(Localize.Done, entityName, Localize.Deleted)); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
private static void Create(string entityName) { string nameParseResult = TryParseProperty.TryParseStringProperty(Localize.PropertyName, entityName); int completenessParseResult = TryParseProperty.TryParseIntProperty(Localize.PropertyCompleteness, entityName); DateTime createdOnParseResult = TryParseProperty.TryParseDateTimeProperty(Localize.PropertyCreatedOn, entityName); Guid typeIdParseResult = TryParseProperty.TryParseGuidProperty(Localize.PropertyTypeId, entityName); Console.WriteLine(Localize.Creating + "..."); try { CRUDOperations.CreateEntity(nameParseResult, completenessParseResult, createdOnParseResult, typeIdParseResult); Console.WriteLine(String.Format(Localize.Done, entityName, Localize.Created)); } catch (Exception ex) { Console.WriteLine(ex.Message); } }