private void WriteGetbytypeMethod(CodeClass2 cls) { var sets = GetExistingSets(cls); var code = General.GetTemplateOutput(output => GenGetbytype(output, sets)); var insertPoint = cls.GetStartPoint(vsCMPart.vsCMPartBody); var manager = new Manager<DbSet, GeneratorOptionAttribute>(TagFormat.Json); var writer = manager.CreateWriter(cls); writer.OptionTag.Trigger.Type = TriggerTypes.CodeSnippet; writer.InsertStart = insertPoint; writer.TargetRange = new TaggedRange() {StartPoint = cls.StartPoint, EndPoint = cls.EndPoint}; writer.Content = code; writer.TagNote = "GetDbsetByType"; writer.InsertOrReplace(true); }