How do you share gRPC proto definitions between services

I am specifying a number of independent services that will all be hosted out of the same server process. Each service is defined in its own protobuf file. These are then run through the tools to giv...

Receive file and other form data together in ASP.NET Core Web API (boundary based request parsing)

How would you form your parameters for the action method which is supposed to receive one `file` and one `text` value from the request? I tried this ``` public string Post([FromBody]string name, [Fr...

12 Jan at 04:20

NSubstitute to return a Null for an object

I am new to unit testing and it sounds to me like it should be easy to get NSubstitute to be able to return null for a method but I cannot get it to work. I have tried this for a Get method that shou...

16 Nov at 07:36

How to include views in ServiceStack.OrmLite T4

The T4 for generating DB Poco files was updated and I see an [IncludeViews](https://github.com/ServiceStack/ServiceStack.OrmLite/blob/master/src/T4/OrmLite.Core.ttinclude#L89) variable. However I don'...

15 Nov at 23:46

Determine at runtime which db provider is being used, with EF Core

In our ASP.NET Core and EF Core system, we use different databases for different parts of the system. I need to be able to tell, at runtime, which db provider is being used, because some stuff needs t...

Facebook SDK manually set session token

I am using ServiceStack to authorise a user via either credentials (username or password) or Facebook. I make a call to the ServiceStack auth endpoint /auth/facebook and set a few headers, and pass t...

15 Nov at 22:11

Entity Framework not including columns with default value in insert into query

I have a model that has some columns defined with default values like ``` table.Column<bool>(nullable: false, defaultValueSql: "1") ``` When I save a new entity in the database using `context.Sav...

C# UDP Broadcast and receive example

Problem: I am trying to bind a udp socket on a specific address. I will broadcast out a message. That same socket will need to be able to receive messages. Current code: ``` static void Main() { ...

15 Nov at 18:23

Disabling Entity Framework proxy creation

From what I've read, setting `ProxyCreationEnabled = false` will prevent change tracking and lazy loading. However, I'm not clear on what change tracking covers. If I disable it and get an entity fr...

15 Nov at 16:30

Handling exception in asp.net core?

I have asp.net core application. The implementation of configure method redirects the user to "Error" page when there is an exception ( in non Development environment) However it only works if the...

Accessing ASP.NET Core DI Container From Static Factory Class

I've created an ASP.NET Core MVC/WebApi site that has a RabbitMQ subscriber based off James Still's blog article [Real-World PubSub Messaging with RabbitMQ](http://www.squarewidget.com/real-world-pubs...

CreateParam does not have an implementation

I am trying to run the Sqllite inmemory database together with ServiceStack. Console App in Visual Studio .net 4.6.1 (if I run the same code in LinqPad it is working fine) Platform target: x64 Ins...

15 Nov at 14:46

Reason for ExtractMethodCodeRefactoringProvider encountered an error and has been disabled?

I'm getting this error, when I'm trying to extract the method from code by using right-click on a selected code(Quick Actions and Refactoring) or `Ctrl + .`. I'm using Visual Studio 2015. I'm able to...

15 Mar at 10:7

FTP client in .NET Core

Can I download file / list files via FTP protocol using ? I know, I can use [FtpWebRequest](https://learn.microsoft.com/en-us/dotnet/api/system.net.ftpwebrequest) or [FluentFTP](https://www.nuget.org/...

5 Oct at 13:44

Pattern for caching data in Asp.Net Core + EF Core?

I have an Asp.Net Core + EF Core REST service. I created a DbContext class for a DB I want to call a SP on. The method pretty much looks like: ``` public IQueryable<xxx> Getxxxs() { return Set<xx...

EF Core - Table '*.__EFMigrationsHistory' doesn't exist

I created my DbContext and added it in DI, however when I do `dotnet ef database update -v` it does not want to create the migrations table `__EFMigrationsHistory`. Is there some other command that...

Invalid DeviceToken Length when sending passkit push by PushSharp

I try to use PushSharp in an Apple passkit related project. My current problem is about passkit pushes. When I try to create my notification, it says > device tokent length is invalid (exact exce...

Plotly js responsive graph in div

I am making a page with dynamically created divs that resize on mouseover using a simple css class. I use it so these divs are small when the page is loaded then if a user wants a closer look they jus...

7 May at 08:26

How to retrieve latest record using RowKey or Timestamp in Azure Table storage

Tricky part is `RowKey` is `string` which is having value like `Mon Nov 14 12:26:42 2016` I tried query using `Timestamp` like ``` var lowerlimit = DateTime.UtcNow; // its should be nearer to table...

14 Nov at 17:46

How do I properly use the Api Attribute in ServiceStack to name a service in SwaggerUI?

Using Swagger-UI and ServiceStack, I'm trying to use the `Api` attribute to name my services a little cleaner. I am having a hard time figuring out where the attribute needs to be for it to add a `de...

14 Nov at 14:20

How to use Xamarin forms' Button.ContentLayout property?

Using the latest pre-release, I noticed that the button now has a Button.ContentLayout property, which I am hoping will allow us to add custom views to buttons whilst retaining the rest of the buttons...

14 Nov at 11:50

Why people use CommandManager.InvalidateRequerySuggested() on ICommands?

I am making some custom ICommand implementation of my own and I see A LOT of implementations going like this: ``` public event EventHandler CanExecuteChanged { add { CommandManager.RequerySuggest...

14 Nov at 10:18

Getting the public properties of a class in .NET core

I notice that .NET core doesn't allow `myObj.GetType().GetProperties()` as no `GetProperties` method exists. Is there another way to obtain the properties of a class through reflection?

21 Jan at 07:47

Xamarin.Forms Binding Specified cast is not valid

I have a weird exception where the Compiler tells me that the Specified cast is not valid even though what im doing is very Simple. I have a ListView binded to a ObservableCollection. And inside my L...

13 Nov at 16:23

Fastest method to remove Empty rows and Columns From Excel Files using Interop

I have a lot of excel files that contains data and it contains empty rows and empty columns. like shown bellow [](https://i.stack.imgur.com/BirO8.png) I am trying to remove Empty rows and columns f...