Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Should Html.PrimeCache be named Html.PrimeCacheAsync? #246

Description

@justinvp

MVC APIs that return Task/Task<T> have the Async suffix, e.g. Html.PartialAsync.

For consistency with MVC APIs and as an indicator to developers that they should @await the result, shouldn't Html.PrimeCache be named Html.PrimeCacheAsync?

Activity

  1. SteveSandersonMS commented on Aug 8, 2016

    @SteveSandersonMS
    Member

    Yes, I think you're right! Will add that as a new overload and will mark the old one as obsolete.

  2. justinvp commented on Aug 8, 2016

    @justinvp
    Author

    While you're at it, maybe the new overload should return Task<IHtmlContent> instead of Task<HtmlString> (like Html.PartialAsync), which would allow the results to be written to a TextWriter instead of having to concatenate/format/allocate a (potentially large) string to return with HtmlString? HtmlString itself implements IHtmlContent so the existing implementation could remain as-is for now; returning Task<IHtmlContent> leaves the door open to perf improvements in the future.

  3. justinvp commented on Aug 8, 2016

    @justinvp
    Author

    (To give you an idea, I prototyped some potential changes to the existing implementation earlier this weekend: 4c7bdcf)

  4. SteveSandersonMS commented on Aug 16, 2016

    @SteveSandersonMS
    Member

    Implemented. As per your suggestion, also changed the return type to Task<IHtmlContent>. Currently it's still using HtmlString but could change to a custom less-allocatey alternative like your prototype in the future.

  5. added a commit that references this issue on Aug 17, 2016
    e7b7d33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions