Commit Graph

226 Commits

Author SHA1 Message Date
Yongguang Zhu 1253cbdf71
Includes a gRPC sample (#382)
* add GrpcSample, GrpcClient; update DaprClient

* disable TLS for grpc server

* implement deposit and withdraw method for grpcsample

* implement event handler for deposit and withdraw

* edit readme for grpcsample

* improve readme

* fix @amanbha requested changes

* fix or improve readme @vinayada1 reviewed

* use parameter in DaprClient to switch invocation of routing or grpcsample service

* add separate editorconfig file into samples directory

* add license header into grpcsample

* fix TypeConverters  to use internal access modifier; remove useless code; fix Console to logger; fix typo; fix using statement location

* throw a exception when account is not found for BankingService Withdraw invocation

* remove TypeConverters dependence

* use config for rpc-exception argument

* fix comment of @vinayada1

* updated documentation for parameters usage

* fix additional comments from @vinayada1

* Update Readme.md

* fix DaprClient's compile error

Co-authored-by: Yongguang Zhu <Yongguang.Zhu@microsoft.com>
Co-authored-by: vinayada1 <28875764+vinayada1@users.noreply.github.com>
Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2020-12-02 17:52:43 -08:00
Ryan Nowak e95a5567f2
Implement dependency injection for Actors (#463)
* Implement dependency injection for Actors

Fixes: #171

This change allows Actors to accept dependency-injected services through
constructor parameters.

There are numerous breaking changes in this PR that are visible to user
code. In most cases these are simplifications.

For example the Actor base class accepted 3 constructor parameters,
which meant that every subclass (every actor type) also had 3 constructor
parameters. This isn't fun and becomes way less fun now that users can
add their own constructor parameters in a meaningful way.

As another example, we had multiple places where "runtime options" lived
that had different interaction patterns. Now there's a single options
type and you interactive with it through UseActors(...).

* address PR feedback

* React to API change
2020-12-01 10:15:08 -08:00
vinayada1 6a5d8ea09d
remove binaryformatter (#456)
* remove binaryformatter
2020-11-30 16:24:10 -08:00
Ryan Nowak 116d984b4e
Rename and cleanup of HTTPExtension (#488)
* Rename and cleanup of HTTPExtension

Fixes: #421

This change renames `HTTPExtension`->`HttpInvocationOptions`. This is more
idiomatic in .NET and reflects existing naming conventions (options or
settings for parameters).

Also changes to use the `System.Net.Http.HttpMethod` type for the http
method, and globally prefer the term `method` over `verb`. Every .NET
API that I'm aware of uses 'method', as does rfc7231.

* One more rename
2020-11-30 12:11:44 -08:00
vinayada1 80f2319fe4
Handle rpc exception thrown for operation cancellation (#455)
* Handle cancelled cancellation token

* add UTs

* add secrets UT

* fix review comments

* invoke and await in one call

* fix await

* Add test for multiple calls to UseActors (#459)

Fixes: #411

The bug was actually addressed in PR #453 - this change adds a test that
verifies that we actually fixed it.

Co-authored-by: vinayada1 <28875764+vinayada1@users.noreply.github.com>

* use grpcChannelOptions ThrowOperationCanceledOnCancellation

* Add doc

* add link to doc

Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2020-11-19 11:22:33 -08:00
Dasith Wijesiriwardena f6f434d6e6
Fluent methods for creating and manipulating HTTPExtension (#473)
* HTTPExtension fluent methods

* add tests

Co-authored-by: vinayada1 <28875764+vinayada1@users.noreply.github.com>
2020-11-17 12:58:02 -08:00
Ryan Nowak 721ea4a1be
Add test for multiple calls to UseActors (#459)
Fixes: #411

The bug was actually addressed in PR #453 - this change adds a test that
verifies that we actually fixed it.

Co-authored-by: vinayada1 <28875764+vinayada1@users.noreply.github.com>
2020-11-16 13:00:38 -08:00
Ryan Nowak 7d1fa13101
Make ActorId deserializable (#457)
Fixes: #444

ActorId doesn't define a default constructor, and so it's not
deserializable via System.Text.Json.

This change implements a converter so that ActorId's API shape can work
with the serializer properly.

I added an integration test for ActorReference as well, but no library
changes we needed for that, ActorId was the blocker.
2020-11-05 15:10:38 -08:00
vinayada1 4c926c9469
Rich error model (#432)
* add InvokeMethodRawAsync and InvokeMethodWithResponseAsync
Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2020-10-30 13:59:33 -07:00
vinayada1 0ccddf73ff
Logging changes to use ILogger (#453)
* logging changes to use ILogger

Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2020-10-30 13:09:32 -07:00
Ryan Nowak aa682eb462
Remove async void in tests (#447)
Fixes: #446

`async void` is almost always a bug in server-side programming. If these
tests were doing any networking then they would encounter concurrency
bugs or crash in the event of an exception.

Co-authored-by: vinayada1 <28875764+vinayada1@users.noreply.github.com>
2020-10-29 15:54:17 -07:00
Charlie Stanley ab3f45e7e1 Added codecov integration (#436) 2020-10-19 19:06:21 -07:00
Ryan Nowak cd781248c7 Remove static instance of ActorRuntime
Contributes to: #416

This change removes a mutable static instance - this is low-hanging
fruit design improvement and helps us make these features more flexible
in the future.
2020-10-15 16:53:32 -07:00
Ryan Nowak 51ab7ff181 Stop generating docs in samples and tests
Removes generation of documentation files for samples and tests. This is
a vestige from using the older Stylecop tool in this repo, which needs
the doc files to inspect.

The deleterious effect of this is getting warnings about missing
documentation on samples, and forcing contributors and maintainers to
write nonsense comments to workaround the warning.

Also removed references to stylecop, since we no longer use it.
2020-10-10 19:04:00 -07:00
Young Bu Park 3bb6165096
Upgrade grpc to 2.32.0 (#413) 2020-10-07 10:35:57 -07:00
Edwin van Wijk b3aef53d79
Fix use of marker services in DI registration (#403)
* Fix for issue #390

* Fix unit-test naming

Co-authored-by: vinayada1 <28875764+vinayada1@users.noreply.github.com>
2020-09-28 10:24:45 -07:00
Sander Molenkamp 100dbe9794
Send headers as metadata to sidecar (#397)
* Send headers as metadata to sidecar

* Add HTTP headers test

* Allow different kinds of dictionaries
2020-09-24 16:07:44 -07:00
Edwin van Wijk 55e168fac3
Add ability to specify default DaprClient options to AddDapr (#394)
* Add fix for issue 390

* Move JsonSerializer defaults to DaprClientBuilder ctor

* Update samples to reflect changes

* Update unit-tests to reflect latest changes

* Remove obsolete using statements

* Change internal fields to internal properties

* Change internal fields to internal properties
2020-09-24 10:36:47 -07:00
vinayada1 e93357cb9d
State Transaction API changes (#385)
* State Transaction API changes
* Add the optional fields as per API reference
* Fix review comments
* Added transactional state api to sample
2020-09-17 16:12:50 -07:00
Leon Mai bf0354bd39
Add metadata for get/delete state apis (#383)
Co-authored-by: LM <lemai>
2020-09-01 18:27:17 -07:00
Leon Mai 11f6ea45e1
Multi pubsub (#374)
* Prepping for multi pubsub

* Add pubsub name, some cleanup

* multi pubsub changes

Co-authored-by: Aman Bhardwaj <amanbha@microsoft.com>
Co-authored-by: LM <lemai>
2020-08-17 13:58:50 -07:00
Yaron Schneider 6671ab020c
Add bulk get to client (#372)
* Add bulk get to client

* change params, return type, class to struct

* change IList to IReadOnlyList, make parallelism nullable

* change GetBulkItem to BulkStateItem
2020-08-17 09:24:35 -07:00
Gokhan Altinoren aa52a5d6a2
Fixing an issue of a null reference exception where the model binder is checked against a null BindingSource (#371) 2020-08-17 08:57:48 -07:00
Aman Bhardwaj bb3d7326cb
adding tests for DaprHttpInteractor in Actors, removing unused code. (#364) 2020-08-07 12:43:59 -07:00
Aman Bhardwaj 1cd4500a2d
Adding support for DAPR_API_TOKEN (#359)
* Adding support for DAPR_API_TOKEN

* adding retry back for this PR
2020-08-04 15:15:18 -07:00
Aman Bhardwaj b6329539bc
Remove retry options from state apis. (#361)
* Removing retry options for state apis.

* getting latest proto from dapr/dapr
2020-08-04 14:32:16 -07:00
Christian Kaps fdf17b7dbb
Use protobuf packaging for the Any type (#358)
* Use protobuf packaging for the Any type

This pull request implements two converters which help with the type conversion between arbitrary types and the protobuf `Any` type. The C# protobuf library provides a mechanism to pack or unpack protobuf messages to `Any`. It provides the methods `Any.Pack` and `Any.Unpack` to serialize/deserialize messages based on `Google.Protobuf.IMessage`. For types that are not based on `Google.Protobuf.IMessage`, the existing JSON serialization/deserialization will be used.

I've also cleaned the existing codebase a little bit.

Fixes #268

* Fix suggested changes
2020-08-03 10:15:23 -07:00
Leon Mai 1974ab36a8
Remove secret store extension from building (#348)
* Remove secret store extension from building

* Remove code

Co-authored-by: LM <lemai>
Co-authored-by: Aman Bhardwaj <amanbha@users.noreply.github.com>
2020-07-25 09:22:36 -07:00
Christian Kaps 5b246c8665
Include the appcallback.proto into the Dapr.Client package (#349)
* Include the appcallback.proto into the Dapr.Client package

To implement service invocation for a gRPC API, a user must implement the AppCallback service on the callee site. Currently this must be done by integrating the `appcallpack.proto` file as also the depending `common.proto` file into the gRPC service application. The `Dapr.Client` package contains already the same `common.proto` file to generate the client classes. This results in a CS0433 error, because the `Dapr.Client` package and the generated AppCallback service will contain a `Dapr.Client.Autogen.Grpc.v1` namespace with the exact same classes.

This pull requests integrates the `appcallpack.proto` into the client package. With this fix the user does not need to integrate the proto files by itself.

See: https://gitter.im/Dapr/community?at=5f14b7e98a9a0a08cbab5d53

* Remove specific names
2020-07-25 09:20:34 -07:00
Leon Mai 041a2d1255
Update to sdk for changes in proto for bidirectional binding in runtime (#320)
* Update proto for bidirectional binding in runtime

* move arg check

Co-authored-by: LM <lemai>
2020-06-03 11:10:08 -07:00
Sander Molenkamp f3b5c7db81
Update client to latest proto files (#315)
* Update client to latest proto files

* Update PublishEventApiTest.cs

Merge conflict.

Co-authored-by: Leon Mai <lemai@microsoft.com>
2020-05-29 10:35:53 -07:00
Leon Mai ad4095c308
pub/sub - rename refs to 'content' to 'data' (#318)
Co-authored-by: LM <lemai>
2020-05-28 21:09:51 -07:00
Leon Mai 6c27126223
#312 - make changes corresponding to change in dapr runtime. The run… (#313)
* #312 - make changes corresponding to change in dapr runtime.  The runtime will no longer send an activate message.  The SDK should 'activate' an actor anytime it receives an actor method call

* spaces

* remove comment'

Co-authored-by: LM <lemai>
2020-05-16 17:06:49 -07:00
Aman Bhardwaj e773243487
Returning routes for pubsub from aspnetcore integration. (#309)
* Returning routes for pubsub from aspnetcore integration.

* adding ref to System.IO.Pipelines

* updating tests

* not using RawText, using segments in route.

* fixing tests

* Logging a warning for routes with parameters

* Using ILoggerFactory
2020-05-14 15:16:55 -07:00
Leon Mai 465c960b79
httpextension should use post if not specified (#303)
* httpextension should use post if not specified

* make constant

Co-authored-by: LM <lemai>
2020-05-06 17:45:56 -07:00
Leon Mai 44ca6496d8
Move to new invoke proto, specify contenttype in response to the dapr… (#295)
* Move to new invoke proto, specify contenttype in response to the dapr/config message, clarify sample

* Update for additional proto changes

* cr

Co-authored-by: LM <lemai>
2020-04-30 11:47:29 -07:00
Jérôme Piquot 767fba5675
Initializing ActorId with an empty string should throw an exception (#279)
* fix issue 277. Initializing ActorId with an empty string should throw an exception.

* add whitespace check to actorid constructor
2020-04-05 12:02:03 -07:00
Leon Mai 20fabb2141
Support more actor configuration (#269)
* 219 Support the granular Actor config such as actor idle time

* cleanup

* cr

* cr

* refactor

* remove now dead code

* Move setter into properties

Co-authored-by: LM <lemai>
2020-03-30 13:30:00 -07:00
Carlos Mendible f36b52107f
Secret Store configuration provider implementation for Microsoft.Extensions.Configuration (#238)
* Implementing Dapr Secret Store configuration provider

* Improved exception message

Co-authored-by: Aman Bhardwaj <amanbha@users.noreply.github.com>
2020-03-18 10:43:19 -07:00
Aman Bhardwaj 51fc48fb74
Adding & enhancing client apis over gRPC (#244)
* adding IDAprClient interface

* Adding DaprClientBuilder and adding methods for Publish

* updating the method name for publish

* Adding unit tests for publishevent api

* Removing individual clients for publish

* Renaming base class to DaprClient and implementation calss to DparClientGrpc

* Moving State api to grpc and adding helpers to unittest grpc calls.

* More DaprClient logic

* metadata, etag, options, etc are optional

* Revert "metadata, etag, options, etc are optional"

This reverts commit ea5dc12c5d.

* Default params, 2 new Try- methods, overload refactor for InvokeMethodAsync

* Move some classes/enums to different files.  Documentation

* Code refactor and changing tests to use grpc

* Adding tests with state options

* Adding test for getting etag and state

* More refactoring and adding INvokeBinding test

* Fixing tests and tidying up things.

* Updating solutions for renamed project

* Updating projects for rename.

* Oneclient secret (#245)

* ADding Secret Apis

* Using Task for secret

* Format (#242)

* Updating samples.slm

* awaint the call to grpc in common method so that common error handling can be done there.

* Addressing review comments

* fixing test.sln

* updating prod.sln

* Addressing review comments from James.

* Add doc and example for method invocation on http app

* Updating arg validation.

* Updating example.

Co-authored-by: LM <lemai>
Co-authored-by: Carlos Mendible <cmendible@gmail.com>
2020-03-09 20:52:12 -07:00
Carlos Landeras 334766c28a
Pass serializer options to InvokeMethodAsync<TRequest,TResponse> #234 (#235)
* Pass serializer options to InvokeMethodAsync<TRequest,TResponse>

* Fix invoke method serializer options + tests

* Change assertion to already defined response object
2020-02-26 09:20:52 -08:00
Nkosinathi Sangweni d7fea33c45
Malotho/making actorstestable (#229)
* Getting started with Actor testability

* Added unitests against the Actor Class.
This is to verify that there are no breaking changes, and that the actor class can take any ActorStateManager.

* removed the private constructor

* resolving an issue with causing a null reference exception.
This was caused by an incorrect order of assignment in the constructor.
2020-02-21 22:10:06 -08:00
Aman Bhardwaj ea51561f49
git gui, ading editor config and removing depenency on StyleCop.Analyzers (#228) 2020-02-18 13:21:12 -08:00
Aman Bhardwaj b1157cbc4f Revert "Malotho/making actorstestable (#220)"
This reverts commit 1bacce6734.
2020-02-15 09:41:37 -08:00
Nkosinathi Sangweni 1bacce6734
Malotho/making actorstestable (#220)
* Getting started with Actor testability

* Added unitests against the Actor Class.
This is to verify that there are no breaking changes, and that the actor class can take any ActorStateManager.

* removed the private constructor
2020-02-14 09:16:37 -08:00
Dr Christian Geuer-Pollmann bc9de4f813
Close #208 (#209)
* The .NET API states that passing `period: TimeSpan.FromMilliseconds(-1)` to `RegisterReminderAsync` should mean that the riminder never triggers on a recurrence.
When doing so, the serialization of the reminder means that
`IRemindable.ReceiveReminderAsync()` will be called with the dueTime value passed in the state parameter.

I figured that out because I passed an UTF8 JSON string as state, and `IRemindable.ReceiveReminderAsync()` received "0h0m0s1ms" as state, instead of my own value.

## Repro

```csharp
namespace Core.Application.Common.ActorImplementations
{
    using System;
    using System.Text;
    using System.Threading.Tasks;
    using Newtonsoft.Json;
    using Dapr.Actors;
    using Dapr.Actors.Runtime;
    using Core.Domain;

    public class FlightServiceQueryActorState
    {
        public string CoordinatorId { get; set; }

        public byte[] ToBytes() => Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(this));

        public static FlightServiceQueryActorState FromBytes(byte[] bytes) => JsonConvert.DeserializeObject<FlightServiceQueryActorState>(Encoding.UTF8.GetString(bytes));
    }

    [Actor(TypeName = ActorNames.FlightServiceQueryActor)]
    public class FlightServiceQueryActor : Actor, IRemindable, IFlightServiceQueryActor
    {
        public FlightServiceQueryActor(ActorService actorService, ActorId actorId) : base(actorService, actorId) { }

        const string AfterTickReminder = "AfterTick";
        static readonly TimeSpan Never = TimeSpan.FromMilliseconds(-1);

        async Task IFlightServiceQueryActor.Tick(string senderId, int duration)
        {
            var state = new FlightServiceQueryActorState { CoordinatorId = senderId };

            await base.RegisterReminderAsync(
                reminderName: AfterTickReminder,
                state: state.ToBytes(),
                dueTime: TimeSpan.FromMilliseconds(1),
                period: Never);

            await Console.Out.WriteLineAsync($"Tick tock {this.Id.GetId()}");
        }

        async Task IRemindable.ReceiveReminderAsync(string reminderName, byte[] stateBytes, TimeSpan dueTime, TimeSpan period)
        {
            var state = FlightServiceQueryActorState.FromBytes(stateBytes);

            var coordinator = ActorProxies.CreateFlightTravelCoordinationFor(state.CoordinatorId);

            await Console.Out.WriteLineAsync($"Reminder {this.Id.GetId()} -- {state.CoordinatorId}");
        }
    }
}
```

## Result

```text
time="2020-01-25T11:37:35+01:00" level=error msg="error executing reminder: error from actor service: "
fail: Microsoft.AspNetCore.Server.Kestrel[13]
      Connection id "0HLT1GA8OGV6N", Request id "0HLT1GA8OGV6N:00000006": An unhandled exception was thrown by the application.
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
   at Dapr.Actors.Runtime.ConverterUtils.ConvertTimeSpanFromDaprFormat(String valueString) in C:\github\dapr\dotnet-sdk\src\Dapr.Actors\Runtime\ConverterUtils.cs:line 28
   at Dapr.Actors.Runtime.ReminderInfo.DeserializeAsync(Stream stream) in C:\github\dapr\dotnet-sdk\src\Dapr.Actors\Runtime\ReminderInfo.cs:line 56
   at Dapr.Actors.Runtime.ActorManager.FireReminderAsync(ActorId actorId, String reminderName, Stream requestBodyStream, CancellationToken cancellationToken) in C:\github\dapr\dotnet-sdk\src\Dapr.Actors\Runtime\ActorManager.cs:line 162
   at Dapr.Actors.AspNetCore.RouterBuilderExtensions.<>c.<<AddReminderRoute>b__4_0>d.MoveNext() in C:\github\dapr\dotnet-sdk\src\Dapr.Actors.AspNetCore\RouterBuilderExtensions.cs:line 101
```

* Serializes DueTime and Period only when non-negative

* Empty values become default

* Not checking dueTime for negative values. Missing reminder attributes or empty string reminders are equal to "never".

Co-authored-by: Aman Bhardwaj <amanbha@users.noreply.github.com>
2020-02-06 14:35:33 -08:00
Shalabh Mohan Shrivastava 5b8a426e7d
Add support in dotnet client sdk to support multi state store support (#207)
* Including state Store name in the APIs to support multi state store scenario in SDK

* correcting the typo in the comment.

* Respective Changes to the tests

* Changes in StateAttribute and Binder classes to support state store name

* Changes in StateEntryModelBinderTests

* StoreName changes in the Integration test app

* fixing build issues

* Fixing integration tests

* Addressing review comments.

* Addressing review comments

* Updating samples to use correct state store name as generated by dapr cli.

Co-authored-by: Aman Bhardwaj <amanbha@users.noreply.github.com>
2020-02-06 09:06:21 -08:00
Aman Bhardwaj a5078a60c7
Using 127.0.0.1 instead of localhost. (#214)
* Using 127.0.0.1 instead of localhost.

* Updating usage in tests and samples, docs as well.
2020-02-05 12:32:41 -08:00
James Eastham 9e7ce7ee1e
Add PublishHttpClient implementation (#186) (#200)
* Add PublishHttpClient implementation (#186)

* Update PublishHttpClient implementation (#186)

* Refactor AsyncJsonContent to seperate class (#186)
2020-02-05 12:03:34 -08:00
Ryan Nowak b02aa3f02b Add support for delete operations (#198)
* Add support for delete operations

* Removing extra spaces to fix build break.

Co-authored-by: Aman Bhardwaj <amanbha@users.noreply.github.com>
2020-01-09 09:53:13 -08:00
Ryan Nowak c4f80f10b6 Fix URL generation when BaseAddress is used (#194)
Fixes: #192

We were missing tests for the case where the HttpClient has a
BaseAddress set. In these case we'd generate an incorrect URL.

Co-authored-by: Aman Bhardwaj <amanbha@users.noreply.github.com>
2020-01-08 11:41:45 -08:00
Ryan Nowak 793c0a4a36 Get the integration tests to calm down (#195)
Removes console spew when running the integration tests at the command
line

Fixes: #193
2020-01-08 11:36:55 -08:00
Aman Bhardwaj 34835a0224
Build for net core 3.1 (#189) 2019-12-16 09:31:25 -08:00
Aman Bhardwaj 9a499176bf Revert "Build for net core 3.1"
This reverts commit bead12b1d8.
2019-12-15 09:59:08 -08:00
Aman Bhardwaj bead12b1d8 Build for net core 3.1 2019-12-13 20:31:08 -08:00
James Eastham 5562d0d64b Issue 184 (#185)
* Add InvokeClient and InvokeHttpClient dapr #184

* Add tests for InvokeHttpClient dapr#184

* Update namespace of InvokeHttpClient  dapr#184

* Add DI of InvokeHttpClient dapr#184

* Resolve code format issues dapr#184

* Remove InvokeEnvelope and add params to InvokeMethod dapr#184

* Update method signature to use generic types for Request/Response dapr#184

* Update parameter in data null check dapr#184
2019-12-13 10:05:17 -08:00
Aman Bhardwaj 21c88f8795
Making Serialization, Deserialization of ReminderInfo, Timer async and using System.Text.Json for Reminder, Timer and State, (#178)
* Making Serialization, Deserialization of ReminderInfo, Timer async and using System.Text.Json for Reminder, Timer and State,

* Updating tests.

* Addressing review comment: Passing stream directly to serializer.

* Removing dependency on Newtonsoft.Json

* Revert "Removing dependency on Newtonsoft.Json"

This reverts commit 0315781bd0.
2019-12-04 11:39:39 -08:00
Phillip Hoff 916d552279 Allow explicit actor type (#165)
* Refactored ActorRuntime to allow testing.

* Add test for inferred actor type.

* Add RegisterActor() overload.

* Consolidate RegisterActor() implementations.

* Refactor to make type still intrinsic to actor implementation.

* Update docs.

* Revert error codes change.

* Updates per PR feedback.

* Add warning to ActorRuntime constructor.
2019-11-25 09:30:18 -08:00
Aman Bhardwaj af3da0c518
Removing nuspec files for packing. (#139)
* Removing nuspec files for packing.

* adding symbols generation

* Adding solution files for samples, tests & sdk for better organization and targetted builds.
2019-10-27 18:20:54 -07:00
gmanvel f55249830a Move to using span slicing instead of string substrings (#135)
* Move to using span slicing instead of string substrings

* Adding unit test for JsonReaderExtensionsTests ReadValueAsTimeSpanDaprFormat method
2019-10-25 11:31:33 -07:00
Greg Ingram 07fa2c615d Moved to xunit for testing (#127)
* Updated Dapr.AspNetCore.IntegrationTest

* Updated Dapr.AspNetCore.Test

* Updated Dapr.Client.Test

* Updated to latest packages
2019-10-22 16:29:31 -07:00
Greg Ingram eba332e911 Clean ActorId (#121)
* Remove unused using

* Updated parameter names

* Summary spacing and extra text

* Checking for null

* Added ActorId tests and convert to xUnit test framework
2019-10-21 19:25:18 -07:00
Greg Ingram 3d2fbe8b25 Removed unused usings (#122) 2019-10-21 09:53:55 -07:00
Aman Bhardwaj a9e3f78f1b
Add Actor sample. (#94)
* Adding a project with actor service and client.

* Updating the client code

* Adding an Actor sample.
2019-10-13 17:11:42 -07:00
Ryan Nowak a6ef7e451d Add middleware for unwrapping cloud events
Fixes: #74

note: This relies on the fix for dapr/dapr#574 which has been merged.

This change introduces a middleware that can upwrap a *structured* cloud
event. This is the format used by dapr by default now for pub/sub
messaging. Adding the middleware makes it transparent to the developer
whether the data can from a cloud event or was a basic RPC call.

We're adding the middleware for this first since it's the most general
approach. It has a drawback compared with other approaches, performance.

Users could alternatively use the SDK from CloudEvents to read their
data without the middleware.

We might also want to add an MVC formatter in the future, which could do
the unwrapping and deserialization to a user-type in a single operation.
2019-10-12 20:25:38 -07:00
Aman Bhardwaj 4fb29e44e3
Changing to Dapr.* (#89)
* Changing to Dapr.*

* Update readme.md

* keeping things signed
2019-10-11 13:42:30 -07:00
Aman Bhardwaj 9b13557131
Updating license to MIT in all .cs files. (#81)
* Updating license to MIT in all .cs files.

* fixing typos
2019-10-08 14:54:46 -07:00
Aman Bhardwaj 61f6e7d681
Fixing aspnetcore samples (#71) 2019-10-06 16:41:42 +00:00
Ryan Nowak 0b08737cb6 Add Actions Client and ASP.NET Core integration (#61)
* DRY up project settings

Moves repetative project settings into Directory.Build.props so they are
not duplicated so much. I'm adding 5-6 new projects when tests are
included, so it makes sense to try and commonize.

* Add .vscode/ to .gitignore

We really have the choice to either check in a standard set of vscode's
files (if that's something the team cares about) - or ignore them so
that it's not noisy for people that use the repo with VS Code.

The former requires more discussion and effort, so ignoring `.vscode/`
for now makes the most sense.

* Add project skeletons

Decoder-ring for projects:

Microsoft.Dapr.Client[.Test] - client and tests
Microsoft.Dapr.AspNetCore[.Test] ASP.NET Core integration and tests
Microsoft.Dapr.AspNetCore.IntegrationTest[.App] integration tests

RoutingSample - sample using route-to-code
ControllerSample - sample using controllers

* Add Microsoft.Dapr.Client

* Add Routing and Controller samples

* Add integration tests for MVC and routing

* Use ValueTask

* Different paradigm for services

* Fix client constructor

* Add readmes for samples

* Updating pipelin yaml to package aspnetcore packages
2019-10-04 22:11:59 -07:00
Aman Bhardwaj b92179778c
Renaming Actions to Dapr. (#63)
* Renaming Actions to Dapr.

* Updaing docs.

* Renaming more stuff
2019-10-02 15:55:24 -07:00
Aman Bhardwaj a1ef0dd16d
Building for .netcore 3.0 ,making required code changes, updating nuget generation (#60)
* Updating to netcore3.0

* Building for .netcore 3.0 and making required code changes, updating nuget generation.

* Fixing indent in pipeline yaml

* making test interfaces and test classes public to allow codegen

* simplifying default expression (C# 7.1 syntax)

* Using simple using statement (C# 8.0 feature)

* USing unused params and using pattern matching

* Update test/Microsoft.Actions.Actors.Test/ActorMethodInvocationExceptionTests.cs

Co-Authored-By: Ryan Nowak <nowakra@gmail.com>

* using context.Request.RouteValues instead of context.GetRouteData()
2019-10-01 10:57:05 -07:00
Shalabh Mohan Shrivastava 719b411ec9 Adding Custom ActorMethodInvocationException and throw this new exception (#45)
* Adding Actor Custom Exception Class

* Adding custom Actions error code ActionsErrorCodes.ERR_INVOKE_ACTOR for the class

* Throw Custom ActorMethodInvocationException to preserve the remote exception stack

* Adding Unit Test for ActorMethodInvocationException
2019-09-02 07:56:45 -07:00
Aman Bhardwaj 52c93edcae Making IActionsInteractor per ProxyFactory and share it in all proxies. 2019-08-27 11:38:57 -07:00
Aman Bhardwaj 3792c626d9 Updating signing key and always strong name signing 2019-08-24 15:35:39 -07:00
Aman Bhardwaj dcea4bf40d Adding plumbing for dispatch for StronglyTyped invocation on server side. 2019-08-16 17:36:37 -07:00
Shalabh Mohan Shrivastava ce12fe262d
Adding Functionality for Actor Proxy Code Generation Builder classes, Actor Communication and Tests (#13)
* Adding Functionality for Actor Proxy Code Generation Builder classes and Tests

* Adding the interfaces for RequestMessage, RequestMessageBody and RequestMessageHeader

* Adding interfaces for Actor Response Message, Response Message Header and Response Message Body

* Adding concrete classes for Actor Request Message, Request Message Header and Request Message Body

* Adding concrete classes for Actor Response Message, Response Message Header and Response Message Body

* Adding the Outgoing Message interface and concrete class

* Adding the Outgoing Message Header interface and concrete header class

* Adding the Incoming message body concrete class

* Adding the Incoming message body interface

* Adding Functionality for the Actor Communication

* Added the Actor Communication functionality and Refactored further the current code changes
2019-08-16 11:42:18 -07:00