private static string GetSchemaForType(Type type, bool removePackage) { var schema = MessageUtils.GetSchema(type); if (removePackage) { var builder = new StringBuilder(); foreach (var myString in schema.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries)) { if (myString.Contains("package")) { continue; } builder.AppendLine(myString); } schema = builder.ToString(); } return(schema); }
/// <summary> /// Returns the .proto schema for your model /// </summary> /// <returns></returns> public override string ToString() { return(MessageUtils.GetSchema(GetType())); }