Will it be a good solution if a web service directly communicate with database, is it recommended? Further is there any development or helping material to fulfill the requirement like sending auto-emails to customer email address and verifying mobile number as well using One Time Password (OTP).
The Repository, the Repository pattern, sits behind the Web service.
The Repository object in the Repository layer can have many responsibilities, and DB access is just one of the responsibilities where the Repository object calls objects in the Data Access Layer to do CRUD operations with the DB.
The Repository object would call Data Access Objects in the DAL to do CRUD with the DB.
You don't send datasets with datatables through a Web service.
What you send through the layers and through the Web service is a DTO.
Like I said, the Repository object is not solely for database access.
Which Algo is best for OTP (one time password)? Any help full link please?