在4.0版本中有三个地方使用了
<
profile
automaticSaveEnabled
="false"
defaultProvider
="ShoppingCartProvider"
>
<
providers
>
<
add
name
="ShoppingCartProvider"
connectionStringName
="SQLProfileConnString"
type
="PetShop.Profile.PetShopProfileProvider"
applicationName
=".NET Pet Shop 4.0"
/>
<
add
name
="WishListProvider"
connectionStringName
="SQLProfileConnString"
type
="PetShop.Profile.PetShopProfileProvider"
applicationName
=".NET Pet Shop 4.0"
/>
<
add
name
="AccountInfoProvider"
connectionStringName
="SQLProfileConnString"
type
="PetShop.Profile.PetShopProfileProvider"
applicationName
=".NET Pet Shop 4.0"
/>
</
providers
>
<
properties
>
<
add
name
="ShoppingCart"
type
="PetShop.BLL.Cart"
allowAnonymous
="true"
provider
="ShoppingCartProvider"
/>
<
add
name
="WishList"
type
="PetShop.BLL.Cart"
allowAnonymous
="true"
provider
="WishListProvider"
/>
<
add
name
="AccountInfo"
type
="PetShop.Model.AddressInfo"
allowAnonymous
="false"
provider
="AccountInfoProvider"
/>
</
properties
>
</
profile
>
前两个是因为,希望能够在用户未登录的情况下也记录用户的信息,这个我理解,
可是最好这个我就不太理解了,他存的是用户的账号的信息,必须是在登录以后,这个应用一般的操作就可以了,为什么还要用profile呢?
难道说是既然订单等信息都用profile存了,所以干脆和购物相关的账户信息也一快用Profile保存了,有一定的系统性,操作起来也方便,一个profile.save()就可以了?
希望懂得人提点一下