Posts

Showing posts from January 27, 2019

c# mvc login service

Image
0 $begingroup$ I want to make a service which will authorize users. I want to separate it from controller. The problem is, I can't figure out what should my methods return. Here is my method: public async Task<BaseResponse> Login(string email, string pwd) { BaseResponse response = new BaseResponse(); var user = userManager.Users.Where(u => u.Email == email).FirstOrDefault(); if (user == null) { response.Errors.Add(Errors.WrongEmail); } else { var result = await signInManager.PasswordSignInAsync(user, pwd, false, false); if (result.Succeeded) { response.Success = true; } else { response.Errors.Add(Error

Sending two text files with mail command - No -a support [duplicate]

Image
0 This question already has an answer here: Trying to send multiple text attachments via mail message 1 answer I searched but did not find this answer. I am running an old RedHat 5.3 system on one server (working on upgrade to 7 in progress) but I want to send 2 text files using the mail command. I do this all the time with a single file like this: mail username -s 'MySubject' < /home/directory/file1.txt I tried this: mail username -s 'MySubject' < /home/directory/file1.txt < /home/directory/file2.txt But that send the output of the first part including the results of the mail command along with both text files. Is there a better way to do this?