tumtumtum / Shaolinq

ORM for .NET with full LINQ support for Postgres, Sqlite, MySql and SqlServer
Other
127 stars 19 forks source link

AsyncRewriter fails when used on expression body method #68

Open asizikov opened 8 years ago

asizikov commented 8 years ago

Steps to reproduce:

    public partial class Class1
    {
        [RewriteAsync]
        public int Foo() => 10;
    }

This will produce an invalid C# code in GeneratedAsync.cs file:

namespace ClassLibrary3
{
#pragma warning disable
    using System;
    using System.Threading;
    using System.Threading.Tasks;
    using global::ClassLibrary3;

    public partial class Class1
    {
        public Task<int> FooAsync()
        {
            return FooAsync(CancellationToken.None);
        }

        => 10;
        public async Task<int> FooAsync(CancellationToken cancellationToken) => 10;
    }
}