diff --git a/src/Microsoft.AspNet.Mvc.Razor/RazorPage.cs b/src/Microsoft.AspNet.Mvc.Razor/RazorPage.cs index bacbc0799a..9bdc230680 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/RazorPage.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/RazorPage.cs @@ -186,7 +186,7 @@ namespace Microsoft.AspNet.Mvc.Razor /// All writes to the or after calling this method will /// be buffered until is called. /// - public void StartTagHelperWritingScope(TextWriter writer) + public void StartTagHelperWritingScope([NotNull] TextWriter writer) { // If there isn't a base writer take the ViewContext.Writer if (_originalWriter == null) @@ -264,7 +264,7 @@ namespace Microsoft.AspNet.Mvc.Razor /// The to which the /// is written. /// Contains the data to be written. - public void WriteTo(TextWriter writer, ITextWriterCopyable copyableTextWriter) + public void WriteTo([NotNull] TextWriter writer, ITextWriterCopyable copyableTextWriter) { if (copyableTextWriter != null) { @@ -292,7 +292,7 @@ namespace Microsoft.AspNet.Mvc.Razor /// For all other types, the encoded result of is written to the /// . /// - public virtual void WriteTo(TextWriter writer, object value) + public virtual void WriteTo([NotNull] TextWriter writer, object value) { if (value != null && value != HtmlString.Empty) { @@ -334,7 +334,7 @@ namespace Microsoft.AspNet.Mvc.Razor /// /// The instance to write to. /// The to write. - public virtual void WriteTo(TextWriter writer, string value) + public virtual void WriteTo([NotNull] TextWriter writer, string value) { if (!string.IsNullOrEmpty(value)) { @@ -356,7 +356,7 @@ namespace Microsoft.AspNet.Mvc.Razor /// /// The instance to write to. /// The to write. - public virtual void WriteLiteralTo(TextWriter writer, object value) + public virtual void WriteLiteralTo([NotNull] TextWriter writer, object value) { if (value != null) { @@ -368,7 +368,7 @@ namespace Microsoft.AspNet.Mvc.Razor /// Writes the specified without HTML encoding to . /// /// The to write. - public virtual void WriteLiteralTo(TextWriter writer, string value) + public virtual void WriteLiteralTo([NotNull] TextWriter writer, string value) { if (!string.IsNullOrEmpty(value)) { @@ -376,19 +376,21 @@ namespace Microsoft.AspNet.Mvc.Razor } } - public virtual void WriteAttribute(string name, - PositionTagged prefix, - PositionTagged suffix, - params AttributeValue[] values) + public virtual void WriteAttribute( + string name, + [NotNull] PositionTagged prefix, + [NotNull] PositionTagged suffix, + params AttributeValue[] values) { WriteAttributeTo(Output, name, prefix, suffix, values); } - public virtual void WriteAttributeTo(TextWriter writer, - string name, - PositionTagged prefix, - PositionTagged suffix, - params AttributeValue[] values) + public virtual void WriteAttributeTo( + [NotNull] TextWriter writer, + string name, + [NotNull] PositionTagged prefix, + [NotNull] PositionTagged suffix, + params AttributeValue[] values) { var first = true; var wroteSomething = false; @@ -452,7 +454,7 @@ namespace Microsoft.AspNet.Mvc.Razor var sourceLength = next.Position - attrVal.Value.Position; BeginContext(attrVal.Value.Position, sourceLength, isLiteral: attrVal.Literal); - // The extra branching here is to ensure that we call the Write*To(string) overload whe + // The extra branching here is to ensure that we call the Write*To(string) overload where // possible. if (attrVal.Literal && stringValue != null) { @@ -521,7 +523,7 @@ namespace Microsoft.AspNet.Mvc.Razor /// /// The name of the section to create. /// The to execute when rendering the section. - public void DefineSection(string name, RenderAsyncDelegate section) + public void DefineSection([NotNull] string name, [NotNull] RenderAsyncDelegate section) { if (SectionWriters.ContainsKey(name)) {