0

I have a PC based application and mobile app that both send data to my MVC Web API. I was wondering if anyone tracks which application inserted data to the server database?

For instance, when I send data from the mobile app, I mark a IsMobile flag in my table when I insert data.

If the answer is yes, can you briefly explain how you accomplish this and what issues it may have saved you from?

ajpetersen
  • 639
  • 8
  • 17
  • If there is any `User-Agent` header like information in the incoming request...you can use it? – Kiran Mar 14 '14 at 19:03

2 Answers2

0

You could make this as parameter in your web api call and the mobile client sends it with the value "mobile" and the PC sends it as "PC"

In the MVC controller this comes as a variable and then you can store it.

cellik
  • 2,116
  • 2
  • 19
  • 29
0

I decided to use the User-Agent route. I am now creating a log the inserts the HttpContext.Current.Request.UserAgent from every request made to my web API. Here is a link that helped me out.

Community
  • 1
  • 1
ajpetersen
  • 639
  • 8
  • 17