Asp.net core 2.0 remote testing and ef core mocking [closed] - sqlite

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am developing web api(s) for an android app client. Now the developer of the client, wants a way to test web api(s) without getting the real data corrupt. So now I am thinking of something like unit testing and database (ef core) mocking in that except the requests are remote and stateless; so every time the client app requests for data or changing it, the database should remember the last things.
From the docs of Microsoft, there are two ways to do this on unit testing:
SQLite in-memory mode
The InMemory provider
But the thing is that those are volatile and from one request to another request they will be refreshed. So I think SQLite (normal mode - file mode), or using SQLServer with different connection string will be a good solution. Now there are some questions:
Is this a good idea or there is one better?
If it is good, then how should I implement it?
Is it good to add a header in the request?
On the server-side code where should I tell the ef to use testing database?

Related

How to sync firebase with android room local db? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I have an application that has a remote database(firebase) and local database(room). I get my data from firebase and save it in android room. Also, I use rxjava2 to do that. All posts is get from local database. Everything is okey until here. When I put new child to firebase, it doesnt appear in my application instantly. It is not put in local db. I know that I have to update my remote database every time such as every six hours. I had some researxch to do that. Work Manager and JobScheduler can be used but I dont know how to use that. Is there anyone that give me an advise?
WorkManager, part of Jetpack, is a library by Google, that handle deferrable work that requires a guaranteed execution.
You can read this blog to see if it covers your requirements. The documentation is an excellent starting point and there's a codelab that you can do to try the library itself available both in Java and Kotlin.
WorkManager uses JobScheduler when it runs on API Level 23+, for older Android versions (WorkManager supports API Level 14+) it uses AlarmManager and Broadcast receivers.

How to create a Windows Performance Monitor Application [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I need to create my own application that is similar windows performance monitor. I want to monitor the DQL using asp.net. But i don't know where to start. I already research but no luck.
Consider using below components (but still remember, it is only a suggestion) to start from:
System.Diagnostics.PerformanceCounter class - to access performance counter data
ASP.NET MVC - to create a website
SignalR - to create a backend Hub for client notifications of data gathered by PerformanceCounter class
DotNet.Highcharts - to create charts control
What is your planned usage of this application? If you are planning to use it for your organization then you might want to consider SaaS solution that allows you to plug in your collector.
You have better uptime on the monitoring application because that monitoring service is the last thing you want to go down. You are probably more familiar with how to monitor DQL than to create an application that does charting and alerting. You should be able to get something going within days instead of weeks.
Monitoring is normally composed of collecting, storing and charting. A good SaaS monitoring tool will do well with storing and charting and you need to look for ones with plugin framework that allow you to decide what to collect.

MsSQL callback function to asp.net website [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am looking at the possibilities when it comes to making a trigger on a SQL server, trigger a function on my website (without having to poll it every x minutes).
The reason being, I am attempting to create a caching service for my SQL data to where it will only update the cache when there are changes to the table it is setup for. The idea would be that items which are in the database, rarely changed and used often enough to want to skip the expensive trip to the database.
any ideas would be great, thanks.
SQL Server supports event notifications for just this type of problem.
http://msdn.microsoft.com/en-us/library/ms190427(v=sql.105).aspx
If it's data that you want to put in the application cache then you could consider using the SqlCacheDependency class (http://msdn.microsoft.com/en-us/library/ms178604(v=vs.100).aspx). This will expire the cache when there is a predefined change in the database thus avoiding the need for any kind of polling.
Of course it depends what your exact problem is to whether this will meet your needs
SQL Server has CLR integration (albeit at last check, only with .NET 2.0). This means you can run some assembly marked as such from a function/stored-procedure/query. Here is the documentation:
MSDN SQL Server CLR description
You can write an assembly with an exposed method for SQL Server and run it directly from there, thus completing your loop in C#/VB/.NET language of your choosing. This may be a little heavy handed if none of the above answers have what you're looking for, but I'm pretty sure offers the most flexible approach where you control everything.

viability of ASP.NET Web API [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm porting three of my WP7 apps, that use my WCF SOAP Services to Android (so I can make some money for a change). They don't like SOAP over there so I need to make a duplicate version of my WCF service methods to Restful services.
I created a simple working test service some months ago using the WCF REST Service Template 40(CS) template so that's one choice. However I see a lot on the web about ASP.NET Web API using MVC 4.
My question is: Is this fully cooked and going to grow and prosper or is Microsoft going to get me all involved in this and then drop it like a hot potato after I've got a year in it.
I would choose whatever got the job done that was supportable while being the least effort to implement. If I was on a level playing field I would run with the WebAPI mainly because it is very, very smooth. I would also version my API using versioned urls or content negotiation to insulate myself.
I can't speak for Microsoft, but in general they stand behind anything they have released as a fully supported product for quite some time. I'd expect the WebAPI to be supported at least as long as the platform. I don't see Microsoft dropping .NET support anytime soon and I would expect to see .NET 4.0 supported for the foreseeable future.

User upload content [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I wanted to crate an mobile app (using Flex) that let user upload some user generated content (eg. Text, Picture) to my website and also able to display/view it on the website as well.
I don’t much on the back end (web programming, website database, cloud).
What is the best way to do this or is there any ready build solution out there?
Thanks.
Look at httpService for your user upload and tie it to a back end web service using POST or GET parameters. Personally, I recommend PHP but any web capable service would work. Then, tie that service to store your images on your web server or in a database. Reverse the process to get it back out. Can this all be done in Flex? No. Can you tie it in with a web service easily? Yes. Good luck.

Resources