I am working on a MVC project. I have three roles Developer, Administrator & Employee. I have many users in each role. I have three folders(named Developer, Administrator & Employee) in server for each role. When user click on a specific Button, I need to write(append log if file exist already) a small log to a single file to the specific folder according his role. So if A and B are two users of role Developer, they click the button at the same time I need to give synchronous access to the Developer folder for user A and B. So resource here is not single & Specific users need to synchronous access to specific folder. How can I use Lock for this scenario?
I sometimes find Static Lock declaration. What is the difference between the following two lines of code
private static readonly object Locker = new object();
private readonly object Locker = new object();
Please let me know how it is possible?
thanks